Merge "Make RefreshLinksJob handle LinksUpdateConstructed hooks doing DB writes"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sat, 7 Jan 2017 17:58:30 +0000 (17:58 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 7 Jan 2017 17:58:30 +0000 (17:58 +0000)
includes/jobqueue/jobs/RefreshLinksJob.php

index 5f33ae0..651a332 100644 (file)
@@ -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