Removed use of cache in JobQueueFederated pop() method
authorAaron Schulz <aschulz@wikimedia.org>
Sat, 26 Jul 2014 19:37:56 +0000 (12:37 -0700)
committerOri.livneh <ori@wikimedia.org>
Mon, 28 Jul 2014 17:16:08 +0000 (17:16 +0000)
* This does not really buy anything for a number of reason and
  can cause bugs. For example, if the aggregator is notified due
  to undelayed jobs but this cache is not updated, then the runners
  will not see the jobs and will de-list aggregator entry.

bug: 68506
Change-Id: I1eacca108df59fff9c0fcc846aafaf1616cf5895

includes/jobqueue/JobQueueFederated.php

index 01d7ec4..fce30fb 100644 (file)
@@ -316,13 +316,6 @@ class JobQueueFederated extends JobQueue {
        }
 
        protected function doPop() {
-               $key = $this->getCacheKey( 'empty' );
-
-               $isEmpty = $this->cache->get( $key );
-               if ( $isEmpty === 'true' ) {
-                       return false;
-               }
-
                $partitionsTry = $this->partitionRing->getLiveLocationWeights(); // (partition => weight)
 
                $failed = 0;
@@ -351,6 +344,7 @@ class JobQueueFederated extends JobQueue {
                }
                $this->throwErrorIfAllPartitionsDown( $failed );
 
+               $key = $this->getCacheKey( 'empty' );
                $this->cache->set( $key, 'true', JobQueueDB::CACHE_TTL_LONG );
 
                return false;