From 032bed0c2f7e84f36c002c2265edb325763b8d5b Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 12 Jan 2016 13:23:39 -0800 Subject: [PATCH] Make AjaxDispatcher commit transactions before responding Some extension code appears to have sanity commit() calls to work around this in places, which is the wrong solution. Note that there was always the post-send commit, just not the pre-send one that normal requests have. Change-Id: I410a1f1097daa4f43481d1b0afbe7f467b86d254 --- includes/AjaxDispatcher.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/AjaxDispatcher.php b/includes/AjaxDispatcher.php index 96892d710f..c2ea582e63 100644 --- a/includes/AjaxDispatcher.php +++ b/includes/AjaxDispatcher.php @@ -135,6 +135,9 @@ class AjaxDispatcher { $result = new AjaxResponse( $result ); } + // Make sure DB commit succeeds before sending a response + wfGetLBFactory()->commitMasterChanges( __METHOD__ ); + $result->sendHeaders(); $result->printText(); -- 2.20.1