Avoid lock acquisition errors for multi-title refreshlinks jobs
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 17 Aug 2017 09:01:30 +0000 (02:01 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 17 Aug 2017 16:36:56 +0000 (09:36 -0700)
Bug: T173462
Change-Id: I9dab9b4e5c4cae7306dc29bad9e62287d54b2281

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;
        }