From 9bb575be70fbd3893fc8bbc9aadc346077239f17 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 3 Nov 2015 12:47:05 -0800 Subject: [PATCH] Make DeferredUpdates exception handling more robust Change-Id: Ica2b8dce0978818a2f51684b97c93a3ba845d81a --- includes/deferred/DeferredUpdates.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/deferred/DeferredUpdates.php b/includes/deferred/DeferredUpdates.php index 0194a61e0b..8eec202c9d 100644 --- a/includes/deferred/DeferredUpdates.php +++ b/includes/deferred/DeferredUpdates.php @@ -130,11 +130,13 @@ class DeferredUpdates { wfGetLBFactory()->commitMasterChanges(); } catch ( Exception $e ) { // We don't want exceptions thrown during deferred updates to - // be reported to the user since the output is already sent. - // Instead we just log them. + // be reported to the user since the output is already sent if ( !$e instanceof ErrorPageError ) { MWExceptionHandler::logException( $e ); } + // Make sure incomplete transactions are not committed and end any + // open atomic sections so that other DB updates have a chance to run + wfGetLBFactory()->rollbackMasterChanges(); } } -- 2.20.1