r91940 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91939‎ | r91940 | r91941 >
Date:08:08, 12 July 2011
Author:tstarling
Status:ok
Tags:
Comment:
Non-concurrent pop_type() since the $row === false case was being hit 99% of the time on WMF in a backlog situation.
Modified paths:
  • /trunk/phase3/includes/job/JobQueue.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/job/JobQueue.php
@@ -56,15 +56,18 @@
5757
5858 $dbw = wfGetDB( DB_MASTER );
5959
 60+ $dbw->begin();
 61+
6062 $row = $dbw->selectRow(
6163 'job',
6264 '*',
6365 array( 'job_cmd' => $type ),
6466 __METHOD__,
65 - array( 'LIMIT' => 1 )
 67+ array( 'LIMIT' => 1, 'FOR UPDATE' )
6668 );
6769
6870 if ( $row === false ) {
 71+ $dbw->commit();
6972 wfProfileOut( __METHOD__ );
7073 return false;
7174 }

Status & tagging log