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

amiras89 commented Jan 26, 2020

No description provided.

@amiras89 amiras89 requested review from MosheMaorKaltura and ZurKaltura Jan 26, 2020
@@ -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));

This comment has been minimized.

Copy link
@ZurKaltura

ZurKaltura Jan 27, 2020

Contributor

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

This comment has been minimized.

Copy link
@amiras89

amiras89 Jan 27, 2020

Author Contributor

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;

This comment has been minimized.

Copy link
@ZurKaltura

ZurKaltura Jan 27, 2020

Contributor

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

This comment has been minimized.

Copy link
@amiras89

amiras89 Jan 27, 2020

Author Contributor

changed to variables

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

This comment has been minimized.

Copy link
@MosheMaorKaltura

MosheMaorKaltura Jan 28, 2020

Contributor

Use {} for every if

This comment has been minimized.

Copy link
@amiras89

amiras89 Jan 28, 2020

Author Contributor

done

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

This comment has been minimized.

Copy link
@MosheMaorKaltura

MosheMaorKaltura Jan 28, 2020

Contributor

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

This comment has been minimized.

Copy link
@amiras89

amiras89 Jan 28, 2020

Author Contributor

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))

This comment has been minimized.

Copy link
@MosheMaorKaltura

MosheMaorKaltura Jan 28, 2020

Contributor

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');

This comment has been minimized.

Copy link
@MosheMaorKaltura

MosheMaorKaltura Jan 28, 2020

Contributor

Change the message - larger then $filesize

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

This comment has been minimized.

Copy link
@amiras89

amiras89 Jan 28, 2020

Author Contributor

@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;

This comment has been minimized.

Copy link
@MosheMaorKaltura

MosheMaorKaltura Jan 28, 2020

Contributor

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

This comment has been minimized.

Copy link
@amiras89

amiras89 Jan 28, 2020

Author Contributor

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.

@amiras89 amiras89 requested a review from MosheMaorKaltura Jan 28, 2020
@MosheMaorKaltura

This comment has been minimized.

Copy link
Contributor

MosheMaorKaltura commented Jan 28, 2020

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
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.