You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling XREADGROUP with COUNT and BLOCK returns None when the number of items in the stream is less than COUNT. On the first call from the _blocking method, it claims the available items, and because the total items are less than COUNT it returns None. On the second call, after BLOCK milliseconds, no items remain in the stream, resulting in 0 items being returned.
According to Redis documentation, "When the BLOCK command is passed, but there is data to return at least in one of the streams passed, the command is executed synchronously exactly like if the BLOCK option would be missing."
Describe the bug
Calling
XREADGROUP
withCOUNT
andBLOCK
returnsNone
when the number of items in the stream is less thanCOUNT
. On the first call from the_blocking
method, it claims the available items, and because the total items are less than COUNT it returnsNone
. On the second call, afterBLOCK
milliseconds, no items remain in the stream, resulting in 0 items being returned.fakeredis-py/fakeredis/commands_mixins/streams_mixin.py
Line 344 in 697fc90
Expected behavior
According to Redis documentation, "When the BLOCK command is passed, but there is data to return at least in one of the streams passed, the command is executed synchronously exactly like if the BLOCK option would be missing."
To Reproduce
For example:
Running in a
redis-cli
doesn't block when the number of items is lower than COUNT and returns the results:I think
len(stream_results) < count
should be removed from the condition, but let me know if there’s a specific reason for keeping it.Thank you
The text was updated successfully, but these errors were encountered: