Make deferred updates fully own their transaction rounds
authorAaron Schulz <aschulz@wikimedia.org>
Sat, 3 Sep 2016 13:44:31 +0000 (06:44 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Sat, 3 Sep 2016 13:44:31 +0000 (06:44 -0700)
This will matter when commitMasterChanges() enforcement is tighter.
For now, any thing can still call that method anytime.

Change-Id: I0b08e9e9118a6c6118c117e3856d0a8e0ca3d457

includes/deferred/DeferredUpdates.php

index 24c7930..8de7cd9 100644 (file)
@@ -221,9 +221,10 @@ class DeferredUpdates {
        private static function runUpdate( DeferrableUpdate $update, LBFactory $lbFactory, $stage ) {
                $guiError = null;
                try {
-                       $lbFactory->beginMasterChanges( __METHOD__ );
+                       $fnameTrxOwner = get_class( $update ) . '::doUpdate';
+                       $lbFactory->beginMasterChanges( $fnameTrxOwner );
                        $update->doUpdate();
-                       $lbFactory->commitMasterChanges( __METHOD__ );
+                       $lbFactory->commitMasterChanges( $fnameTrxOwner );
                } catch ( Exception $e ) {
                        // Reporting GUI exceptions does not work post-send
                        if ( $e instanceof ErrorPageError && $stage === self::PRESEND ) {