From ca1a36bfe39ba49a651c6d5b53a2f3a30800e32c Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 15 Jul 2014 17:22:39 -0700 Subject: [PATCH] Use job backoff times in the case of high failure rates Change-Id: Ica0c81bfb127e858ec6f1aa193da351930493b2d --- maintenance/runJobs.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 2.20.1