jenkins-bot has submitted this change and it was merged.
Change subject: [JobQueue] In addition to flushing any transaction, be sure to
avoid new ones
......................................................................
[JobQueue] In addition to flushing any transaction, be sure to avoid new ones
* This probably only matters when jobs are not run via CLI scripts.
Change-Id: Ie04c8baac218f5df770388e17096dcb4f2eb9cba
---
M includes/job/JobQueueDB.php
1 file changed, 10 insertions(+), 0 deletions(-)
Approvals:
Demon: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/job/JobQueueDB.php b/includes/job/JobQueueDB.php
index 6f4f6d9..55872d1 100644
--- a/includes/job/JobQueueDB.php
+++ b/includes/job/JobQueueDB.php
@@ -270,6 +270,11 @@
list( $dbw, $scope ) = $this->getMasterDB();
$dbw->commit( __METHOD__, 'flush' ); // flush existing
transaction
+ $autoTrx = $dbw->getFlag( DBO_TRX ); // get current setting
+ $dbw->clearFlag( DBO_TRX ); // make each query its own
transaction
+ $scopedReset = new ScopedCallback( function() use ( $dbw,
$autoTrx ) {
+ $dbw->setFlag( $autoTrx ? DBO_TRX : 0 ); // restore old
setting
+ } );
$uuid = wfRandomString( 32 ); // pop attempt
$job = false; // job popped off
@@ -457,6 +462,11 @@
list( $dbw, $scope ) = $this->getMasterDB();
$dbw->commit( __METHOD__, 'flush' ); // flush existing
transaction
+ $autoTrx = $dbw->getFlag( DBO_TRX ); // get current setting
+ $dbw->clearFlag( DBO_TRX ); // make each query its own
transaction
+ $scopedReset = new ScopedCallback( function() use ( $dbw,
$autoTrx ) {
+ $dbw->setFlag( $autoTrx ? DBO_TRX : 0 ); // restore old
setting
+ } );
// Delete a row with a single DELETE without holding row locks
over RTTs...
$dbw->delete( 'job',
--
To view, visit https://gerrit.wikimedia.org/r/63819
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie04c8baac218f5df770388e17096dcb4f2eb9cba
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Demon <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits