jenkins-bot has submitted this change and it was merged.

Change subject: Removed isQueueDeprioritized()
......................................................................


Removed isQueueDeprioritized()

* This was just a hack for one job type that is not needed anymore
  as no new refreshLinks2 jobs are inserted

Change-Id: I533f1edbd6b6e67f57ce32a9113da3eec420dd08
---
M includes/job/JobQueueGroup.php
M maintenance/nextJobDB.php
2 files changed, 0 insertions(+), 36 deletions(-)

Approvals:
  BryanDavis: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/job/JobQueueGroup.php b/includes/job/JobQueueGroup.php
index 4f11bbf..17b5c99 100644
--- a/includes/job/JobQueueGroup.php
+++ b/includes/job/JobQueueGroup.php
@@ -155,9 +155,6 @@
         */
        public function pop( $qtype = self::TYPE_DEFAULT, $flags = 0 ) {
                if ( is_string( $qtype ) ) { // specific job type
-                       if ( ( $flags & self::USE_PRIORITY ) && 
$this->isQueueDeprioritized( $qtype ) ) {
-                               return false; // back off
-                       }
                        $job = $this->get( $qtype )->pop();
                        if ( !$job ) {
                                
JobQueueAggregator::singleton()->notifyQueueEmpty( $this->wiki, $qtype );
@@ -180,9 +177,6 @@
                        shuffle( $types ); // avoid starvation
 
                        foreach ( $types as $type ) { // for each queue...
-                               if ( ( $flags & self::USE_PRIORITY ) && 
$this->isQueueDeprioritized( $type ) ) {
-                                       continue; // back off
-                               }
                                $job = $this->get( $type )->pop();
                                if ( $job ) { // found
                                        return $job;
@@ -328,32 +322,6 @@
                }
 
                return $this->coalescedQueues;
-       }
-
-       /**
-        * Check if jobs should not be popped of a queue right now.
-        * This is only used for performance, such as to avoid spamming
-        * the queue with many sub-jobs before they actually get run.
-        *
-        * @param string $type
-        * @return bool
-        */
-       public function isQueueDeprioritized( $type ) {
-               if ( $this->cache->has( 'isDeprioritized', $type, 5 ) ) {
-                       return $this->cache->get( 'isDeprioritized', $type );
-               }
-               if ( $type === 'refreshLinks2' ) {
-                       // Don't keep converting refreshLinksPartition => 
refreshLinks jobs if the
-                       // later jobs have not been done yet. This helps 
throttle queue spam.
-                       // @TODO: this is mostly a WMF-specific hack and should 
be removed when
-                       // refreshLinks2 jobs are drained.
-                       $deprioritized = $this->get( 'refreshLinks' 
)->getSize() > 10000;
-                       $this->cache->set( 'isDeprioritized', $type, 
$deprioritized );
-
-                       return $deprioritized;
-               }
-
-               return false;
        }
 
        /**
diff --git a/maintenance/nextJobDB.php b/maintenance/nextJobDB.php
index 06ccccb..9b4d194 100644
--- a/maintenance/nextJobDB.php
+++ b/maintenance/nextJobDB.php
@@ -78,10 +78,6 @@
                        }
 
                        list( $type, $db ) = $candidates[mt_rand( 0, count( 
$candidates ) - 1 )];
-                       if ( JobQueueGroup::singleton( $db 
)->isQueueDeprioritized( $type ) ) {
-                               $pendingDBs[$type] = array_diff( 
$pendingDBs[$type], array( $db ) );
-                               $again = true;
-                       }
                } while ( $again );
 
                if ( $this->hasOption( 'types' ) ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I533f1edbd6b6e67f57ce32a9113da3eec420dd08
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
Gerrit-Reviewer: BryanDavis <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to