From bec7753c830d1ab0d3d8b6ae57fcd079510efc87 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 16 Nov 2015 20:37:42 -0800 Subject: [PATCH] Make JobRunner::commitMasterChanges() check getServerCount() This is a sanity check to avoid problems in waitForOne() Change-Id: I9792ea8fb69d560bd4adb9bd01515f6456b7e9f3 --- includes/jobqueue/JobRunner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/jobqueue/JobRunner.php b/includes/jobqueue/JobRunner.php index dd2ef8fd3a..b121dfe57e 100644 --- a/includes/jobqueue/JobRunner.php +++ b/includes/jobqueue/JobRunner.php @@ -451,7 +451,7 @@ class JobRunner implements LoggerAwareInterface { global $wgJobSerialCommitThreshold; $lb = wfGetLB( wfWikiID() ); - if ( $wgJobSerialCommitThreshold !== false ) { + if ( $wgJobSerialCommitThreshold !== false && $lb->getServerCount() > 1 ) { // Generally, there is one master connection to the local DB $dbwSerial = $lb->getAnyOpenConnection( $lb->getWriterIndex() ); } else { -- 2.20.1