Skip to content

RedisStreamClusterBroker never recovers unacknowledged messages #130

Description

@baidyprod

Problem

RedisStreamClusterBroker.listen() only ever calls XREADGROUP ... >. Unlike RedisStreamBroker.listen(), it never reads the consumer group's pending-entries list, so there is no XAUTOCLAIM pass.

If a worker dies after a message is delivered but before it is acked, that message stays in the PEL indefinitely: it is never redelivered and never retried, so the task silently never completes. SmartRetryMiddleware doesn't help here, since nothing runs in a process that has already died.

The cluster variant is also missing the corresponding knobs: idle_timeout, unacknowledged_batch_size, unacknowledged_lock_timeout, and xread_count (so XREADGROUP runs uncapped).

Version: taskiq-redis 1.2.2, redis 7.4.1.

Impact

AWS ElastiCache Serverless runs cluster-mode-enabled only, so users on it are forced onto RedisStreamClusterBroker and lose crash recovery as a side effect of their infrastructure choice, with no signal that it happened. The same applies to other managed cluster-mode-only Redis/Valkey offerings.

There's no cluster-specific blocker

XAUTOCLAIM is a single-key command, and the reclaim lock key (autoclaim:{group}:{stream}) is a single key, so both hash to one slot and
work unchanged under cluster mode. RedisCluster exposes equivalent .lock() and .xautoclaim() methods.

Suggestion

Bring RedisStreamClusterBroker.listen() to parity with RedisStreamBroker.listen(), including the accompanying constructor
parameters. Ideally by factoring the reclaim logic into a shared mixin or helper used by both brokers, so the two don't drift again as the non-cluster path evolves.

Metadata

Metadata

Assignees

No one assigned

    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