diff options
author | antirez <antirez@gmail.com> | 2018-06-11 16:51:06 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2018-06-11 16:51:06 +0200 |
commit | 34bd44187ae4a5947995abe8f8e26a5dacb3159b (patch) | |
tree | 9e8a2e5eeb95a0a81cadfbc8f58a2da78e510dba /src/blocked.c | |
parent | b136502d0f9bcf4dad78083f5234d918902b0cc9 (diff) | |
download | redis-34bd44187ae4a5947995abe8f8e26a5dacb3159b.tar.gz |
Fix client unblocking for XREADGROUP, issue #4978.
We unblocked the client too early, when the group name object was no
longer valid in client->bpop, so propagating XCLAIM later in
streamPropagateXCLAIM() deferenced a field already set to NULL.
Diffstat (limited to 'src/blocked.c')
-rw-r--r-- | src/blocked.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/blocked.c b/src/blocked.c index 8d1157c2c..e0dd56724 100644 --- a/src/blocked.c +++ b/src/blocked.c @@ -398,12 +398,6 @@ void handleClientsBlockedOnKeys(void) { 1); } - /* Note that after we unblock the client, 'gt' - * and other receiver->bpop stuff are no longer - * valid, so we must do the setup above before - * this call. */ - unblockClient(receiver); - /* Emit the two elements sub-array consisting of * the name of the stream and the data we * extracted from it. Wrapped in a single-item @@ -419,6 +413,12 @@ void handleClientsBlockedOnKeys(void) { streamReplyWithRange(receiver,s,&start,NULL, receiver->bpop.xread_count, 0, group, consumer, 0, &pi); + + /* Note that after we unblock the client, 'gt' + * and other receiver->bpop stuff are no longer + * valid, so we must do the setup above before + * this call. */ + unblockClient(receiver); } } } |