From e534e9aa8368dc2578384f33a874730a5ac83da9 Mon Sep 17 00:00:00 2001
From: antirez <antirez@gmail.com>
Date: Tue, 12 Jun 2018 17:28:40 +0200
Subject: [PATCH] In scanDatabaseForReadyLists() now we need to handle ZSETs as
 well.

Since the introduction of ZPOP makes this needed. Thanks to @oranagra
for reporting.
---
 src/db.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/db.c b/src/db.c
index 6c039e12..16928aa0 100644
--- a/src/db.c
+++ b/src/db.c
@@ -942,16 +942,18 @@ void moveCommand(client *c) {
 }
 
 /* Helper function for dbSwapDatabases(): scans the list of keys that have
- * one or more blocked clients for B[LR]POP or other list blocking commands
- * and signal the keys are ready if they are lists. See the comment where
- * the function is used for more info. */
+ * one or more blocked clients for B[LR]POP or other blocking commands
+ * and signal the keys as ready if they are of the right type. See the comment
+ * where the function is used for more info. */
 void scanDatabaseForReadyLists(redisDb *db) {
     dictEntry *de;
     dictIterator *di = dictGetSafeIterator(db->blocking_keys);
     while((de = dictNext(di)) != NULL) {
         robj *key = dictGetKey(de);
         robj *value = lookupKey(db,key,LOOKUP_NOTOUCH);
-        if (value && (value->type == OBJ_LIST || value->type == OBJ_STREAM))
+        if (value && (value->type == OBJ_LIST ||
+                      value->type == OBJ_STREAM ||
+                      value->type == OBJ_ZSET))
             signalKeyAsReady(db, key);
     }
     dictReleaseIterator(di);