-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No-Plat: Source map will not return by default + serve latest bundle … #12937
base: Ursa-21.1.0
Are you sure you want to change the base?
Conversation
…if failed to create new one
{ | ||
switch ($ex->getCode()) | ||
{ | ||
case kCoreException::LOCK_TIMED_OUT: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this case cover the 2 cases? case 1 - Bundle is in action and new requests are rejected - 5xx error,
case 2 - Bundler failed / reset and returns 4xx error?
The only case that should return error is when the bundled content is missing some of the pieces and user gets explicit error in the response
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This covers only lock timeout the other changes in the code that call tryServingExistingCacheVersion are the cases that handle bundle failure.
alpha/apps/kaltura/modules/extwidget/actions/embedPlaykitJsAction.class.php
Outdated
Show resolved
Hide resolved
$bundleContent = $context->bundleCache->get($existingCacheVersion); | ||
if ($bundleContent) | ||
{ | ||
$i18nContent = $context->bundleCache->get($existingCacheVersion . "_i18n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use '
@@ -47,6 +48,7 @@ class embedPlaykitJsAction extends sfAction | |||
private $playerConfig = null; | |||
private $uiConfUpdatedAt = null; | |||
private $regenerate = false; | |||
private $includeSourceMap = "false"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to load this default value from config, so in case we are catastrophy mode, we can change this value fast, but in general - hold it with value true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't make sense the default will be true as the entire purpose of this change is that the source map won't be returned by default.
$versions = $this->getRequestParameter(self::VERSIONS_PARAM_NAME); | ||
if($versions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most KMS related calls are using versions, so not sure why to remove this, assume that all the case coming from a website to load UI conf, may constantly come with versions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the list of versions sent by KMS is dynamic and can change I want to avoid constantly changing the hash values associated with the player. When sending versions this means there is no constant bundle hash and this is a use case I don't wont to handle.
|
||
protected function tryServingExistingCacheVersion($context, $errCode, $message = null) | ||
{ | ||
$existingCacheVersion = $context->uiConf->getCurrentCacheKey(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
general note -
Saving current cache key on UI conf is not essential, as the current cache key can be calculated 'on the spot' from the versions that are currently required by it ( hash( ui confi versions ) while the action of saving new version on UICONF in DB, will create load on DB any time new version will be released.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The entire point is that the current hash of versions is not in the cache, this is why we got to this point in the first place. I need the old hash of the UI conf versions, which I currently don't have a way to get. If in the future we will have the old version map also stored we can re-visit this.
Also, this is why I added "if(rand(0, 100) < kConf::get("current_version_save_ration", kConfMapNames::EMBED_PLAYKIT, 30))" which means the save will be random with a low percentage so we won't cause any system load.
…if failed to create new one