Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/89097


Change subject: Try to make sure jobs will not get pushed twice on failures
......................................................................

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
---
M includes/job/JobQueueFederated.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/97/89097/1

diff --git a/includes/job/JobQueueFederated.php 
b/includes/job/JobQueueFederated.php
index d788c98..4257da4 100644
--- a/includes/job/JobQueueFederated.php
+++ b/includes/job/JobQueueFederated.php
@@ -253,7 +253,7 @@
                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 @@
                        } 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() );

-- 
To view, visit https://gerrit.wikimedia.org/r/89097
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id73b34f3500f8aeaf456e6bcac862a1e4832c870
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to