From: Aaron Schulz Date: Thu, 10 Oct 2013 19:16:34 +0000 (-0700) Subject: Try to make sure jobs will not get pushed twice on failures X-Git-Tag: 1.31.0-rc.0~18481 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/journal.php?a=commitdiff_plain;h=917f915b4be2a4e54dc16d1eff47501344b75854;p=lhc%2Fweb%2Fwiklou.git 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 --- 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() );