Avoid site outages due to broken job queues
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 11 Apr 2014 22:00:12 +0000 (15:00 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 11 Apr 2014 22:00:12 +0000 (15:00 -0700)
Change-Id: I71f1bef886850679812e23b8a49fc9b80d9b6102

includes/Wiki.php

index fbafba8..6835504 100644 (file)
@@ -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',