From: Aaron Schulz Date: Wed, 16 Jul 2014 00:22:39 +0000 (-0700) Subject: Use job backoff times in the case of high failure rates X-Git-Tag: 1.31.0-rc.0~14928^2 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=ca1a36bfe39ba49a651c6d5b53a2f3a30800e32c;p=lhc%2Fweb%2Fwiklou.git Use job backoff times in the case of high failure rates Change-Id: Ica0c81bfb127e858ec6f1aa193da351930493b2d --- diff --git a/maintenance/runJobs.php b/maintenance/runJobs.php index 9b86e1b617..1383a8ac6b 100644 --- a/maintenance/runJobs.php +++ b/maintenance/runJobs.php @@ -131,8 +131,11 @@ class RunJobs extends Maintenance { $this->runJobsLog( $job->toString() . " t=$timeMs good" ); } - // Back off of certain jobs for a while + // Back off of certain jobs for a while (for throttling and for errors) $ttw = $this->getBackoffTimeToWait( $job ); + if ( $status === false && mt_rand( 0, 49 ) == 0 ) { + $ttw = max( $ttw, 30 ); + } if ( $ttw > 0 ) { $jType = $job->getType(); $backoffs[$jType] = isset( $backoffs[$jType] ) ? $backoffs[$jType] : 0;