X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fdeferred%2FDeferredUpdates.php;h=3716971bca3c638260a75090ce45a03990dc6914;hp=d43ffbc97553a94576c176eb39f551caff9603e8;hb=54c93f1d384cd5accd2db2ebbb911e4d627c2980;hpb=574bd38c04cda411b6382046e0553d85fffc9aa9 diff --git a/includes/deferred/DeferredUpdates.php b/includes/deferred/DeferredUpdates.php index d43ffbc975..3716971bca 100644 --- a/includes/deferred/DeferredUpdates.php +++ b/includes/deferred/DeferredUpdates.php @@ -161,6 +161,7 @@ class DeferredUpdates { if ( isset( $queue[$class] ) ) { /** @var MergeableUpdate $existingUpdate */ $existingUpdate = $queue[$class]; + '@phan-var MergeableUpdate $existingUpdate'; $existingUpdate->merge( $update ); // Move the update to the end to handle things like mergeable purge // updates that might depend on the prior updates in the queue running @@ -362,11 +363,16 @@ class DeferredUpdates { $update->setTransactionTicket( $ticket ); } - $fnameTrxOwner = get_class( $update ) . '::doUpdate'; + // Designate $update::doUpdate() as the write round owner + $fnameTrxOwner = ( $update instanceof DeferrableCallback ) + ? $update->getOrigin() + : get_class( $update ) . '::doUpdate'; + // Determine whether the write round will be explicit or implicit $useExplicitTrxRound = !( $update instanceof TransactionRoundAwareUpdate && $update->getTransactionRoundRequirement() == $update::TRX_ROUND_ABSENT ); + // Flush any pending changes left over from an implicit transaction round if ( $useExplicitTrxRound ) { $lbFactory->beginMasterChanges( $fnameTrxOwner ); // new explicit round