Aaron Schulz has uploaded a new change for review.

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

Change subject: Avoid doNotifyQueueEmpty() race conditions for Redis
......................................................................

Avoid doNotifyQueueEmpty() race conditions for Redis

Previously, races could cause queues to be seen as empty
and ignored when they actually have jobs in them.

Change-Id: I6cdf5c1fbd33c9ed7982e5d2d494974b1d7e09fd
---
M includes/jobqueue/aggregator/JobQueueAggregatorRedis.php
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/42/252342/1

diff --git a/includes/jobqueue/aggregator/JobQueueAggregatorRedis.php 
b/includes/jobqueue/aggregator/JobQueueAggregatorRedis.php
index 6c49646..f8a0040 100644
--- a/includes/jobqueue/aggregator/JobQueueAggregatorRedis.php
+++ b/includes/jobqueue/aggregator/JobQueueAggregatorRedis.php
@@ -59,7 +59,11 @@
                        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 ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6cdf5c1fbd33c9ed7982e5d2d494974b1d7e09fd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <asch...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to