Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/190412

Change subject: Handle ready job queues with no defined class better
......................................................................

Handle ready job queues with no defined class better

Change-Id: I7f4f61ab6b579b363c7093d9cb0507cf644ca7ba
---
M includes/jobqueue/JobQueueGroup.php
1 file changed, 10 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/12/190412/1

diff --git a/includes/jobqueue/JobQueueGroup.php 
b/includes/jobqueue/JobQueueGroup.php
index dbb85d7..f8b79c5 100644
--- a/includes/jobqueue/JobQueueGroup.php
+++ b/includes/jobqueue/JobQueueGroup.php
@@ -152,6 +152,16 @@
 
                if ( is_string( $qtype ) ) { // specific job type
                        if ( !in_array( $qtype, $blacklist ) ) {
+                               // Unrecognized jobs can be pushed to foreign 
wiki queues which
+                               // cannot be run. Throw an error, but first 
clear the queue from
+                               // the aggregator so this doesn't happen again 
soon. However, the
+                               // runner daemon may repopulate the aggregrator 
periodically.
+                               $typeMap = $this->getCachedConfigVar( 
'wgJobClasses' );
+                               if ( !isset( $typeMap[$qtype] ) ) {
+                                       
JobQueueAggregator::singleton()->notifyQueueEmpty( $this->wiki, $qtype );
+                                       throw new MWException( "Unrecognized 
job type '{$qtype}'." );
+                               }
+
                                $job = $this->get( $qtype )->pop();
                                if ( !$job ) {
                                        
JobQueueAggregator::singleton()->notifyQueueEmpty( $this->wiki, $qtype );

-- 
To view, visit https://gerrit.wikimedia.org/r/190412
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7f4f61ab6b579b363c7093d9cb0507cf644ca7ba
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to