jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/376745 )

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
(cherry picked from commit dbaec78dbba7de0cf063d01fcb4bcb53ba1e4e4e)
---
M includes/deferred/LinksDeletionUpdate.php
M includes/page/WikiPage.php
2 files changed, 9 insertions(+), 2 deletions(-)

Approvals:
  Aaron Schulz: 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 a687900..da9b93d 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/376745
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: REL1_29
Gerrit-Owner: Martineznovo <martinezn...@gmail.com>
Gerrit-Reviewer: Aaron Schulz <asch...@wikimedia.org>
Gerrit-Reviewer: Martineznovo <martinezn...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to