Merge "Made runJobs.php fully respect $wgJobBackoffThrottling"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 8 Apr 2014 16:15:30 +0000 (16:15 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 8 Apr 2014 16:15:30 +0000 (16:15 +0000)
1  2 
includes/DefaultSettings.php
maintenance/runJobs.php

@@@ -3362,7 -3362,7 +3362,7 @@@ $wgResourceLoaderLESSFunctions = array
   * @since 1.22
   */
  $wgResourceLoaderLESSImportPaths = array(
 -      "$IP/resources/mediawiki.less/",
 +      "$IP/resources/src/mediawiki.less/",
        "$IP/skins/vector/",
  );
  
@@@ -5637,10 -5637,6 +5637,10 @@@ $wgRC2UDPOmitBots = false
   *   * 'formatter' -- the class name (implementing RCFeedFormatter) which will
   *     produce the text to send.
   *   * 'omit_bots' -- whether the bot edits should be in the feed
 + *   * 'omit_anon' -- whether anonymous edits should be in the feed
 + *   * 'omit_user' -- whether edits by registered users should be in the feed
 + *   * 'omit_minor' -- whether minor edits should be in the feed
 + *   * 'omit_patrolled' -- whether patrolled edits should be in the feed
   *  The IRC-specific options are:
   *   * 'add_interwiki_prefix' -- whether the titles should be prefixed with
   *     the first entry in the $wgLocalInterwikis array (or the value of
@@@ -6032,7 -6028,7 +6032,7 @@@ $wgExtensionMessagesFiles = array()
   */
  $wgMessagesDirs = array(
        'core' => "$IP/languages/i18n",
 -      'oojs-ui' => "$IP/resources/oojs-ui/i18n",
 +      'oojs-ui' => "$IP/resources/lib/oojs-ui/i18n",
  );
  
  /**
@@@ -6211,6 -6207,7 +6211,7 @@@ $wgJobTypesExcludedFromDefaultQueue = a
   * on each job runner process. The meaning of "work items" varies per job,
   * but typically would be something like "pages to update". A single job
   * may have a variable number of work items, as is the case with batch jobs.
+  * This is used by runJobs.php and not jobs run via $wgJobRunRate.
   * These settings should be global to all wikis.
   */
  $wgJobBackoffThrottling = array();
diff --combined maintenance/runJobs.php
@@@ -36,6 -36,7 +36,7 @@@ class RunJobs extends Maintenance 
                $this->addOption( 'maxtime', 'Maximum amount of wall-clock time', false, true );
                $this->addOption( 'type', 'Type of job to run', false, true );
                $this->addOption( 'procs', 'Number of processes to use', false, true );
+               $this->addOption( 'nothrottle', 'Ignore job throttling configuration', false, false );
        }
  
        public function memoryLimit() {
@@@ -66,6 -67,7 +67,7 @@@
                $type = $this->getOption( 'type', false );
                $maxJobs = $this->getOption( 'maxjobs', false );
                $maxTime = $this->getOption( 'maxtime', false );
+               $noThrottle = $this->hasOption( 'nothrottle' );
                $startTime = time();
  
                $group = JobQueueGroup::singleton();
                $flags = JobQueueGroup::USE_CACHE;
                $lastTime = time(); // time since last slave check
                do {
+                       $backoffs = array_filter( $backoffs, $backoffExpireFunc );
+                       $blacklist = $noThrottle ? array() : array_keys( $backoffs );
                        if ( $type === false ) {
-                               $backoffs = array_filter( $backoffs, $backoffExpireFunc );
-                               $blacklist = array_keys( $backoffs );
                                $job = $group->pop( JobQueueGroup::TYPE_DEFAULT, $flags, $blacklist );
+                       } elseif ( in_array( $type, $blacklist ) ) {
+                               $job = false; // requested queue in backoff state
                        } else {
                                $job = $group->pop( $type ); // job from a single queue
                        }
                                        $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