From: Aaron Schulz Date: Thu, 4 Apr 2019 23:25:00 +0000 (-0700) Subject: Add missing transaction round commit calls to RefreshLinksJob X-Git-Tag: 1.34.0-rc.0~2154^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/%22http:/wikimediafoundation.org/fundraising/%7B%7B%20url_for%28%27user_settings%27%2C%20userid=session.userid%29%20%7D%7D?a=commitdiff_plain;h=203ae7e10419c5b89cbd295c5191c6ec51ddd81b;p=lhc%2Fweb%2Fwiklou.git Add missing transaction round commit calls to RefreshLinksJob Follow-up to 83933a436e1ee9d Bug: T220037 Change-Id: Ib1ac31365f9c325c56bae11aefe825ad2b2be881 --- diff --git a/includes/jobqueue/jobs/RefreshLinksJob.php b/includes/jobqueue/jobs/RefreshLinksJob.php index 0cfaebea71..b1c805b4a4 100644 --- a/includes/jobqueue/jobs/RefreshLinksJob.php +++ b/includes/jobqueue/jobs/RefreshLinksJob.php @@ -157,6 +157,7 @@ class RefreshLinksJob extends Job { /** @noinspection PhpUnusedLocalVariableInspection */ $scopedLock = LinksUpdate::acquirePageLock( $dbw, $page->getId(), 'job' ); if ( $scopedLock === null ) { + $lbFactory->commitMasterChanges( __METHOD__ ); // Another job is already updating the page, likely for an older revision (T170596). $this->setLastError( 'LinksUpdate already running for this page, try again later.' ); return false; @@ -179,10 +180,12 @@ class RefreshLinksJob extends Job { } if ( !$revision ) { + $lbFactory->commitMasterChanges( __METHOD__ ); $stats->increment( 'refreshlinks.rev_not_found' ); $this->setLastError( "Revision not found for {$title->getPrefixedDBkey()}" ); return false; // just deleted? } elseif ( $revision->getId() != $latest || $revision->getPageId() !== $page->getId() ) { + $lbFactory->commitMasterChanges( __METHOD__ ); // Do not clobber over newer updates with older ones. If all jobs where FIFO and // serialized, it would be OK to update links based on older revisions since it // would eventually get to the latest. Since that is not the case (by design), @@ -212,6 +215,7 @@ class RefreshLinksJob extends Job { } if ( $page->getLinksTimestamp() > $skewedTimestamp ) { + $lbFactory->commitMasterChanges( __METHOD__ ); // Something already updated the backlinks since this job was made $stats->increment( 'refreshlinks.update_skipped' ); return true;