Catch Error exceptions in MediaWiki::run()
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 9 Feb 2018 19:14:08 +0000 (11:14 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 9 Feb 2018 19:14:11 +0000 (11:14 -0800)
commit12d380b37e1bff0675e007a773b05fa004693f9a
tree681fcfa44d817d62bae15265e04a886051a0daaa
parentd4fb0ae7e9da10f609fbb34aca137aece98744d4
Catch Error exceptions in MediaWiki::run()

This avoids triggering other exceptions down the road such as
"Got COMMIT while atomic sections FileDeleteForm::doDelete,
LocalFile::lockingTransaction are still open". Those would
happen in LBFactory::__destruct(), when it tries to commit any
dangling transactions (firing attached callbacks too). Just like
with the Exception case, the DBs needs to all be rolled back.

Also make LoadBalancer::rolbackMasterChanges() rollback any
explicit transactions even if they have no pending changes.
This clears up the state to avoid later atomic section errors.

Change-Id: Ic0b6b12c1edc1eec239f4f048359b3bbb497d3ff
includes/MediaWiki.php
includes/libs/rdbms/loadbalancer/LoadBalancer.php