From 2eac3278a423b0af6cd0e9469f6880bbae28d8e1 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 11 Apr 2014 15:00:12 -0700 Subject: [PATCH] Avoid site outages due to broken job queues Change-Id: I71f1bef886850679812e23b8a49fc9b80d9b6102 --- includes/Wiki.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/includes/Wiki.php b/includes/Wiki.php index fbafba8139..68355046aa 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -651,8 +651,13 @@ class MediaWiki { 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', -- 2.20.1