Skip to content

[BUG] XREADGROUP with no results does not reset XINFO CONSUMERS idle timer #9996

@jgaskins

Description

@jgaskins

Describe the bug

The idle field of the XINFO CONSUMERS return value is documented as:

idle: the number of milliseconds that have passed since the consumer last interacted with the server

This number does not reset when the XREADGROUP command for that consumer returns an empty result.

To reproduce

XGROUP CREATE my-stream my-group 0 MKSTREAM
XGROUP CREATECONSUMER my-stream my-group my-consumer

… some time passes …

XREADGROUP GROUP my-group my-consumer COUNT 10 BLOCK 2000 STREAMS my-stream >
XINFO CONSUMERS my-stream my-group

Expected behavior

The idle field in the XINFO CONSUMERS return value, based on the phrase "since the consumer last interacted with the server" in the documentation, seems like it should return the time since that XREADGROUP command finished, since XREADGROUP is an interaction from the consumer.

Additional information

When XREADGROUP returns a non-empty array, it does seem to reset the idle timer, but not when it returns an empty array.

I'm trying to add functionality to a streaming library to remove stale consumers (for example, stream processors that have crashed due to OOM or SEGV) but it does not appear to be possible to automate for a low-volume consumer since the last message and the last interaction appear to be set to the same time.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions