Skip to content
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

SUP-20262: increase process timeout to 20 min for entries > 2GB #9131

Merged
merged 6 commits into from
Jan 28, 2020

Conversation

amiras89
Copy link
Contributor

No description provided.

@@ -265,6 +269,7 @@ protected function doSubmit(KalturaDistributionSubmitJobData $data, KalturaYoutu
$media->setFileSize(filesize($videoPath));
$ingestedVideo = self::uploadInChunks($media,$videoPath, self::DEFAULT_CHUNK_SIZE_BYTE);
$client->setDefer(false);
$this->shouldIncreaseProcessedTimeout(filesize($videoPath));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You call this function should which usually means it should return true or false but the function actually does change the timeout

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to "setLongProcessedTimeout($fileSize);"
But it doesn't always 'set' it (depends on fileSize)
If you have a better name suggestions - I'm open to it.

@@ -41,6 +41,10 @@ class YoutubeApiDistributionEngine extends DistributionEngine implements

const TIME_TO_WAIT_FOR_YOUTUBE_TRANSCODING = 5;

const SIZE_2_GB = 2147483648;

const LONG_PROCESS_TIMEOUT = 1200;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it better to change it to a configuration value instead of const in the code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to variables

{
if (isset(KBatchBase::$taskConfig->params->youtubeApi))
{
if (isset(KBatchBase::$taskConfig->params->youtubeApi->longProcessedTimeout))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use {} for every if

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

if (isset(KBatchBase::$taskConfig->params->youtubeApi))
{
if (isset(KBatchBase::$taskConfig->params->youtubeApi->longProcessedTimeout))
$this->longProcessedTimeout = KBatchBase::$taskConfig->params->youtubeApi->longProcessedTimeout;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If value is not set in the configuration file - supply default value hard coded

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default values set lines 33-35

if (isset(KBatchBase::$taskConfig->params->youtubeApi->longProcessedTimeout))
$this->longProcessedTimeout = KBatchBase::$taskConfig->params->youtubeApi->longProcessedTimeout;

if (isset(KBatchBase::$taskConfig->params->youtubeApi->bigFile))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here - if no value , then set default hard coded.

if ($fileSize > $this->bigFile)
{
$this->processedTimeout = $this->longProcessedTimeout;
KalturaLog::info('Increased processed timeout to '.$this->processedTimeout.' seconds for file larger than 2GB');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the message - larger then $filesize

Comment on lines +33 to +35
protected $processedTimeout = 300;
protected $longProcessedTimeout = 1200;
protected $bigFile = 2147483648;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MosheMaorKaltura default values

@@ -30,7 +30,9 @@ class YoutubeApiDistributionEngine extends DistributionEngine implements
{
protected $tempXmlPath;
protected $timeout = 90;
protected $processedTimeout = 300;
protected $processedTimeout = 300;
protected $longProcessedTimeout = 1200;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea was to use this default values if they are not set in configuration

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I set both properties on the class, then we either override them from config (if config exist) otherwise we keep the default values defined on class.

protected $processedTimeout = 300;
protected $longProcessedTimeout = 1200;

Let me know if I confused it.

@MosheMaorKaltura
Copy link
Contributor

reviewed

@amiras89 amiras89 merged commit 707ade4 into Orion-15.16.0 Jan 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants