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
}
}
+ MWExceptionHandler::handleException( $e );
+ } catch ( Error $e ) {
+ // Type errors and such: at least handle it now and clean up the LBFactory state
MWExceptionHandler::handleException( $e );
}
$this->trxRoundId = false;
$this->forEachOpenMasterConnection(
function ( IDatabase $conn ) use ( $fname, $restore ) {
- if ( $conn->writesOrCallbacksPending() ) {
+ if ( $conn->writesOrCallbacksPending() || $conn->explicitTrxActive() ) {
$conn->rollback( $fname, $conn::FLUSHING_ALL_PEERS );
}
if ( $restore ) {