Aaron Schulz has uploaded a new change for review.

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

Change subject: Make flushDeferredQueue() not try to commit the transaction 
round
......................................................................

Make flushDeferredQueue() not try to commit the transaction round

It will flush the jobs to the main PRESEND queue instead.
Trying to run deferred updates here causes DBTransactionError
in LBFactory::beginMasterChanges().

Maintenance scripts already try to run jobs in various points,
so is not likely to be a build up problem (it even queues some
updates as Jobs if the buffer is too big). Nevertheless, call
DeferredUpdates::tryOpportunisticExecute() after adding the
jobs to main queue, in case they *can* safely be run.

Change-Id: Id1bf70c586fd06d4fda94721e60fed982441bee5
---
M includes/Import/Importer.php
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/31/308331/1

diff --git a/includes/Import/Importer.php b/includes/Import/Importer.php
index 1cff2fa..f320ac6 100644
--- a/includes/Import/Importer.php
+++ b/includes/Import/Importer.php
@@ -430,9 +430,12 @@
 
        protected function flushDeferredQueue() {
                while ( !$this->deferredQueue->isEmpty() ) {
-                       DeferredUpdates::addCallableUpdate( 
$this->deferredQueue->dequeue() );
+                       DeferredUpdates::addCallableUpdate(
+                               $this->deferredQueue->dequeue(),
+                               DeferredUpdates::PRESEND
+                       );
+                       DeferredUpdates::tryOpportunisticExecute();
                }
-               DeferredUpdates::doUpdates();
        }
 
        protected function clearDeferredQueue() {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id1bf70c586fd06d4fda94721e60fed982441bee5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <asch...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to