Commit d769ce0a authored by antirez's avatar antirez
Browse files

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.
parent 280b2dc1
...@@ -398,12 +398,6 @@ void handleClientsBlockedOnKeys(void) { ...@@ -398,12 +398,6 @@ void handleClientsBlockedOnKeys(void) {
1); 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 /* Emit the two elements sub-array consisting of
* the name of the stream and the data we * the name of the stream and the data we
* extracted from it. Wrapped in a single-item * extracted from it. Wrapped in a single-item
...@@ -419,6 +413,12 @@ void handleClientsBlockedOnKeys(void) { ...@@ -419,6 +413,12 @@ void handleClientsBlockedOnKeys(void) {
streamReplyWithRange(receiver,s,&start,NULL, streamReplyWithRange(receiver,s,&start,NULL,
receiver->bpop.xread_count, receiver->bpop.xread_count,
0, group, consumer, 0, &pi); 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);
} }
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment