From 917f915b4be2a4e54dc16d1eff47501344b75854 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 10 Oct 2013 12:16:34 -0700 Subject: [PATCH] Try to make sure jobs will not get pushed twice on failures * Some queues like the DB one, might split up batches into chunks which we do not want when used by federated queues (it already manages chunking anyway). If only X of Y got inserted, then they would all get inserted into another partition, causing duplicates Change-Id: Id73b34f3500f8aeaf456e6bcac862a1e4832c870 --- includes/job/JobQueueFederated.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/job/JobQueueFederated.php b/includes/job/JobQueueFederated.php index d788c98b42..4257da43a0 100644 --- a/includes/job/JobQueueFederated.php +++ b/includes/job/JobQueueFederated.php @@ -253,7 +253,7 @@ class JobQueueFederated extends JobQueue { foreach ( $uJobsByPartition as $partition => $jobBatch ) { $queue = $this->partitionQueues[$partition]; try { - $ok = $queue->doBatchPush( $jobBatch, $flags ); + $ok = $queue->doBatchPush( $jobBatch, $flags | self::QOS_ATOMIC ); } catch ( JobQueueError $e ) { $ok = false; wfDebugLog( 'exception', $e->getLogMessage() ); @@ -274,7 +274,7 @@ class JobQueueFederated extends JobQueue { } else { $queue = $this->partitionQueues[$partition]; try { - $ok = $queue->doBatchPush( $jobBatch, $flags ); + $ok = $queue->doBatchPush( $jobBatch, $flags | self::QOS_ATOMIC ); } catch ( JobQueueError $e ) { $ok = false; wfDebugLog( 'exception', $e->getLogMessage() ); -- 2.20.1