From 2d4ed16bd8cc70de1742c8b06ec65928971b6b8e Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 6 Jan 2017 21:52:29 -0800 Subject: [PATCH] Make RefreshLinksJob handle LinksUpdateConstructed hooks doing DB writes Bug: T153618 Change-Id: Iae52e9225fe132f2aa99e161611bf8258736d38d --- includes/jobqueue/jobs/RefreshLinksJob.php | 5 +++++ 1 file changed, 5 insertions(+) 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 -- 2.20.1