mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 17:10:50 +00:00
Fix XCLAIM missing entry bug.
This bug had a double effect: 1. Sometimes entries may not be emitted, producing broken protocol where the array length was greater than the emitted entires, blocking the client waiting for more data. 2. Some other time the right entry was claimed, but a wrong entry was returned to the client. This fix should correct both the instances.
This commit is contained in:
parent
514bbdd670
commit
6ba50784b5
@ -2278,8 +2278,9 @@ void xclaimCommand(client *c) {
|
|||||||
if (justid) {
|
if (justid) {
|
||||||
addReplyStreamID(c,&id);
|
addReplyStreamID(c,&id);
|
||||||
} else {
|
} else {
|
||||||
streamReplyWithRange(c,o->ptr,&id,NULL,1,0,NULL,NULL,
|
size_t emitted = streamReplyWithRange(c,o->ptr,&id,&id,1,0,
|
||||||
STREAM_RWR_RAWENTRIES,NULL);
|
NULL,NULL,STREAM_RWR_RAWENTRIES,NULL);
|
||||||
|
if (!emitted) addReply(c,shared.nullbulk);
|
||||||
}
|
}
|
||||||
arraylen++;
|
arraylen++;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user