From: Aaron Schulz Date: Sat, 7 Jan 2017 05:52:29 +0000 (-0800) Subject: Make RefreshLinksJob handle LinksUpdateConstructed hooks doing DB writes X-Git-Tag: 1.31.0-rc.0~4369^2 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=2d4ed16bd8cc70de1742c8b06ec65928971b6b8e;p=lhc%2Fweb%2Fwiklou.git Make RefreshLinksJob handle LinksUpdateConstructed hooks doing DB writes Bug: T153618 Change-Id: Iae52e9225fe132f2aa99e161611bf8258736d38d --- diff --git a/includes/jobqueue/jobs/RefreshLinksJob.php b/includes/jobqueue/jobs/RefreshLinksJob.php index 5f33ae045e..651a332d5e 100644 --- a/includes/jobqueue/jobs/RefreshLinksJob.php +++ b/includes/jobqueue/jobs/RefreshLinksJob.php @@ -247,6 +247,11 @@ class RefreshLinksJob extends Job { $parserOutput ); + // For legacy hook handlers doing updates via LinksUpdateConstructed, make sure + // any pending writes they made get flushed before the doUpdate() calls below. + // This avoids snapshot-clearing errors in LinksUpdate::acquirePageLock(). + $lbFactory->commitAndWaitForReplication( __METHOD__, $ticket ); + foreach ( $updates as $key => $update ) { // FIXME: This code probably shouldn't be here? // Needed by things like Echo notifications which need