keys after brpop causes crash due to timeout not being reset (#662)

This commit is contained in:
Malavan Sotheeswaran 2023-05-30 01:01:51 -04:00 committed by GitHub
parent 3336c4f43e
commit dc419a4e6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -732,6 +732,7 @@ void unblockClientWaitingData(client *c) {
c->bpop.xread_group = NULL; c->bpop.xread_group = NULL;
c->bpop.xread_consumer = NULL; c->bpop.xread_consumer = NULL;
} }
c->bpop.timeout = 0;
} }
static int getBlockedTypeByType(int type) { static int getBlockedTypeByType(int type) {

View File

@ -1069,6 +1069,13 @@ start_server {
r ping r ping
} {PONG} } {PONG}
test "Regression for bug 659 - chaining BRPOP with async blocking cmds" {
r flushall
r brpop foo 1
r keys *
r ping
} {PONG}
test "client unblock tests" { test "client unblock tests" {
r del l r del l
set rd [redis_deferring_client] set rd [redis_deferring_client]