Fixed usage of ChronologyProtector in MediaWiki
authorAaron Schulz <aschulz@wikimedia.org>
Mon, 24 Aug 2015 21:46:19 +0000 (14:46 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Mon, 24 Aug 2015 22:11:14 +0000 (15:11 -0700)
* 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

index f488aa2..e9946a8 100644 (file)
@@ -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' );
        }
 
        /**