Previously, races could cause queues to be seen as empty
and ignored when they actually have jobs in them.
Change-Id: I6cdf5c1fbd33c9ed7982e5d2d494974b1d7e09fd
return false;
}
try {
- $conn->hDel( $this->getReadyQueueKey(), $this->encQueueName( $type, $wiki ) );
+ // Make sure doNotifyQueueNonEmpty() takes precedence to avoid races
+ $conn->watch( $this->getReadyQueueKey() );
+ $conn->multi()
+ ->hDel( $this->getReadyQueueKey(), $this->encQueueName( $type, $wiki ) )
+ ->exec();
return true;
} catch ( RedisException $e ) {