From 1bbfb2a313f74f753d71604683c6aef9c1e09662 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Tue, 12 Jul 2011 08:08:58 +0000 Subject: [PATCH] Non-concurrent pop_type() since the $row === false case was being hit 99% of the time on WMF in a backlog situation. --- includes/job/JobQueue.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; } -- 2.20.1