Skip to content

Commit d303bca

Browse files
committed
Fix brpop command table entry and redirect blocked clients.
1 parent 8b768e8 commit d303bca

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/cluster.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5418,8 +5418,9 @@ int clusterRedirectBlockedClientIfNeeded(client *c) {
54185418
return 1;
54195419
}
54205420

5421+
/* All keys must belong to the same slot, so check first key only. */
54215422
di = dictGetIterator(c->bpop.keys);
5422-
while((de = dictNext(di)) != NULL) {
5423+
if ((de = dictNext(di)) != NULL) {
54235424
robj *key = dictGetKey(de);
54245425
int slot = keyHashSlot((char*)key->ptr, sdslen(key->ptr));
54255426
clusterNode *node = server.cluster->slots[slot];

src/server.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ struct redisCommand redisCommandTable[] = {
152152
{"linsert",linsertCommand,5,"wm",0,NULL,1,1,1,0,0},
153153
{"rpop",rpopCommand,2,"wF",0,NULL,1,1,1,0,0},
154154
{"lpop",lpopCommand,2,"wF",0,NULL,1,1,1,0,0},
155-
{"brpop",brpopCommand,-3,"ws",0,NULL,1,1,1,0,0},
155+
{"brpop",brpopCommand,-3,"ws",0,NULL,1,-2,1,0,0},
156156
{"brpoplpush",brpoplpushCommand,4,"wms",0,NULL,1,2,1,0,0},
157157
{"blpop",blpopCommand,-3,"ws",0,NULL,1,-2,1,0,0},
158158
{"llen",llenCommand,2,"rF",0,NULL,1,1,1,0,0},

0 commit comments

Comments
 (0)