jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356520 )
Change subject: Avoid scoped lock errors in Category::refreshCounts() due to nesting ...................................................................... Avoid scoped lock errors in Category::refreshCounts() due to nesting Bug: T166757 Change-Id: Ie59523a8b3315f063c914cd25d7b53c11e03fbcd --- M includes/deferred/LinksDeletionUpdate.php M includes/page/WikiPage.php 2 files changed, 9 insertions(+), 2 deletions(-) Approvals: Chad: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/deferred/LinksDeletionUpdate.php b/includes/deferred/LinksDeletionUpdate.php index ca29078..3dd9de6 100644 --- a/includes/deferred/LinksDeletionUpdate.php +++ b/includes/deferred/LinksDeletionUpdate.php @@ -106,7 +106,11 @@ __METHOD__ ); if ( $row ) { - Category::newFromRow( $row, $title )->refreshCounts(); + $cat = Category::newFromRow( $row, $title ); + // T166757: do the update after the main job DB commit + DeferredUpdates::addCallableUpdate( function () use ( $cat ) { + $cat->refreshCounts(); + } ); } } diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index 7489f44..2adc5fb 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -3496,7 +3496,10 @@ ); foreach ( $rows as $row ) { $cat = Category::newFromRow( $row ); - $cat->refreshCounts(); + // T166757: do the update after this DB commit + DeferredUpdates::addCallableUpdate( function () use ( $cat ) { + $cat->refreshCounts(); + } ); } } } -- To view, visit https://gerrit.wikimedia.org/r/356520 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie59523a8b3315f063c914cd25d7b53c11e03fbcd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron Schulz <asch...@wikimedia.org> Gerrit-Reviewer: Chad <ch...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits