public function run() {
try {
$this->checkMaxLag();
- $this->main();
+ try {
+ $this->main();
+ } catch ( ErrorPageError $e ) {
+ // Bug 62091: while exceptions are convenient to bubble up GUI errors,
+ // they are not internal application faults. As with normal requests, this
+ // should commit, print the output, do deferred updates, jobs, and profiling.
+ wfGetLBFactory()->commitMasterChanges();
+ $e->report(); // display the GUI error
+ }
if ( function_exists( 'fastcgi_finish_request' ) ) {
fastcgi_finish_request();
}
return;
}
- if ( !JobQueueGroup::singleton()->queuesHaveJobs( JobQueueGroup::TYPE_DEFAULT ) ) {
- return; // do not send request if there are probably no jobs
+ try {
+ if ( !JobQueueGroup::singleton()->queuesHaveJobs( JobQueueGroup::TYPE_DEFAULT ) ) {
+ return; // do not send request if there are probably no jobs
+ }
+ } catch ( JobQueueError $e ) {
+ MWExceptionHandler::logException( $e );
+ return; // do not make the site unavailable
}
$query = array( 'title' => 'Special:RunJobs',