From: Tim Starling Date: Tue, 12 Jul 2011 08:08:58 +0000 (+0000) Subject: Non-concurrent pop_type() since the $row === false case was being hit 99% of the... X-Git-Tag: 1.31.0-rc.0~28918 X-Git-Url: http://git.cyclocoop.org/%27.parametre_url%28%20%20%20generer_action_auteur%28%27charger_plugin%27%2C%20%27update_flux%27%29%2C%27update_flux%27%2C%20%27oui%27%29.%27?a=commitdiff_plain;h=1bbfb2a313f74f753d71604683c6aef9c1e09662;p=lhc%2Fweb%2Fwiklou.git Non-concurrent pop_type() since the $row === false case was being hit 99% of the time on WMF in a backlog situation. --- diff --git a/includes/job/JobQueue.php b/includes/job/JobQueue.php index 953d5869a4..0d917ba3e6 100644 --- a/includes/job/JobQueue.php +++ b/includes/job/JobQueue.php @@ -56,15 +56,18 @@ abstract class Job { $dbw = wfGetDB( DB_MASTER ); + $dbw->begin(); + $row = $dbw->selectRow( 'job', '*', array( 'job_cmd' => $type ), __METHOD__, - array( 'LIMIT' => 1 ) + array( 'LIMIT' => 1, 'FOR UPDATE' ) ); if ( $row === false ) { + $dbw->commit(); wfProfileOut( __METHOD__ ); return false; }