Open prabhpreet opened 1 year ago
@prabhpreet Thanks for the report. Let me try to answer your questions 1) This seems to be a bug. You are right, the blocked consumers should continue to wait until they get actually a response. We are working on the fix.
2) Yes, this behavior is different and we are aware of it. I will open an internal ticket for this but since this is urgent we may postpone the fix.
3) The consumers are basically racing for the read. The ones available(waiting on XREADGROUP) will read first always. When there are multiple ones waiting, the implementation relies on the fairness of sync.Condition.Signal. I think we can say that it is mostly fair but not always. So first one to block on read usually
gets the next items.
Thanks, appreciate the quick response & looking forward to the fix!
Hello,
I'm using Redis Streams and have noticed two discrepancies with Redis Open source (
Redis version=7.2.1
):XREADGROUP
sends nil response for blocking consumers on a group other than the consumer receiving the actual message contents.XINFO CONSUMERS
does not list consumers which are listening usingXREADGROUP
if they have not received a message yet. This is different from Redis Open Source where it shows all consumers irrespective of whether it has received a message yet.See below a simple test scenario with four Redis client instances- the client on the left creates a stream called
ts
with a grouptest
, adds messages to the stream and lists consumers. The clients on the three columns on the right use theXREADGROUP
command with consumersc1
,c2
,c3
to listen in a blocked fashion. Clientsc1
andc3
receive nil responses whenc2
recieves the actual message contents.On multiple occasions, I have checked for registered consumers with
XINFO CONSUMERS ts test
which only showsc2
as a consumer since it was the only one that received the messages (no acknowledgement after). Later, a message toc1
was finally delivered (seen in screenshot here), and the other consumers received a nil response. Listing consumers withXINFO CONSUMERS
after this listedc1
andc2
as consumers (not in screenshot here).