Aaron Schulz has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382275 )

Change subject: Make Database::rollback() also suppress callback errors
......................................................................

Make Database::rollback() also suppress callback errors

This is consistent with query error suppression, let the
listener callbacks have a chance to run. This also makes
LoadBalancer::rollbackMasterChanges move on to the other
connections.

Change-Id: Ic8b9dd4b868bfe69b04fb20f7be5fce11d864fc4
---
M includes/libs/rdbms/database/Database.php
M includes/libs/rdbms/database/IDatabase.php
2 files changed, 12 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/75/382275/1

diff --git a/includes/libs/rdbms/database/Database.php 
b/includes/libs/rdbms/database/Database.php
index 3c0a2ad..bc1454b 100644
--- a/includes/libs/rdbms/database/Database.php
+++ b/includes/libs/rdbms/database/Database.php
@@ -3078,8 +3078,16 @@
 
                $this->mTrxIdleCallbacks = []; // clear
                $this->mTrxPreCommitCallbacks = []; // clear
-               $this->runOnTransactionIdleCallbacks( self::TRIGGER_ROLLBACK );
-               $this->runTransactionListenerCallbacks( self::TRIGGER_ROLLBACK 
);
+               try {
+                       $this->runOnTransactionIdleCallbacks( 
self::TRIGGER_ROLLBACK );
+               } catch ( Exception $e ) {
+                       // already logged; finish and let LoadBalancer move on 
during mass-rollback
+               }
+               try {
+                       $this->runTransactionListenerCallbacks( 
self::TRIGGER_ROLLBACK );
+               } catch ( Exception $e ) {
+                       // already logged; let LoadBalancer move on during 
mass-rollback
+               }
        }
 
        /**
diff --git a/includes/libs/rdbms/database/IDatabase.php 
b/includes/libs/rdbms/database/IDatabase.php
index 5d0e03f..67e8e85 100644
--- a/includes/libs/rdbms/database/IDatabase.php
+++ b/includes/libs/rdbms/database/IDatabase.php
@@ -1594,6 +1594,8 @@
         * throwing an Exception is preferrable, using a pre-installed error 
handler to trigger
         * rollback (in any case, failure to issue COMMIT will cause rollback 
server-side).
         *
+        * Query, connection, and onTransaction* callback errors will be 
suppressed and logged.
+        *
         * @param string $fname Calling function name
         * @param string $flush Flush flag, set to a situationally valid 
IDatabase::FLUSHING_*
         *   constant to disable warnings about calling rollback when no 
transaction is in

-- 
To view, visit https://gerrit.wikimedia.org/r/382275
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic8b9dd4b868bfe69b04fb20f7be5fce11d864fc4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to