If there is an unhandled exception during a job, rollback the
transaction to be safe. Otherwise its likely that the
transaction will be commited when next job is run, as $dbw->begin()
implicitly commits any open pending transactions. This can result
in database referential integrity issues.
Change-Id: I5807e64440ff6c6651fbbb4924645d05d843b98e
}
} while ( --$n && $job );
} catch ( MWException $e ) {
+ MWExceptionHandler::rollbackMasterChangesAndLog( $e );
// We don't want exceptions thrown during job execution to
// be reported to the user since the output is already sent.
// Instead we just log them.
$status = $job->run();
$error = $job->getLastError();
} catch ( MWException $e ) {
+ MWExceptionHandler::rollbackMasterChangesAndLog( $e );
$status = false;
$error = get_class( $e ) . ': ' . $e->getMessage();
$e->report(); // write error to STDERR and the log