Merge "Avoid lock acquisition errors for multi-title refreshlinks jobs"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 17 Aug 2017 16:55:54 +0000 (16:55 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 17 Aug 2017 16:55:54 +0000 (16:55 +0000)
includes/jobqueue/jobs/RefreshLinksJob.php

index 02bb829..0c84a13 100644 (file)
@@ -279,6 +279,10 @@ class RefreshLinksJob extends Job {
 
                InfoAction::invalidateCache( $title );
 
+               // Commit any writes here in case this method is called in a loop.
+               // In that case, the scoped lock will fail to be acquired.
+               $lbFactory->commitAndWaitForReplication( __METHOD__, $ticket );
+
                return true;
        }