From 5781d545452c31eca76721ee495ae186a5c30c9e Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 24 Aug 2015 14:46:19 -0700 Subject: [PATCH] Fixed usage of ChronologyProtector in MediaWiki * Placed an LB shutdown() call in dePreOutputCommit() so that the positions are properly included in sessions before session write(). They need to be part of the synchronous updates that happen before the user gets the response, otherwise it defeats the whole point of the system. Bug: T101224 Change-Id: Idf367c2aa9aae432a0c4d7cc697366aa544d77f2 --- includes/MediaWiki.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index f488aa2485..e9946a8f18 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -495,7 +495,13 @@ class MediaWiki { public function doPreOutputCommit() { // Either all DBs should commit or none ignore_user_abort( true ); - wfGetLBFactory()->commitMasterChanges(); + + // Commit all changes and record ChronologyProtector positions + $factory = wfGetLBFactory(); + $factory->commitMasterChanges(); + $factory->shutdown(); + + wfDebug( __METHOD__ . ' completed; all transactions committed' ); } /** -- 2.20.1