Skip to content

Consumer proceeds on when ConsumerRebalanceListener fails #917

Open
@braedon

Description

@braedon

I'm using a ConsumerRebalanceListener to load state necessary for processing a partition when it is assigned. However, when ConsumerRebalanceListener.on_partitions_assigned() fails for some reason (i.e. the state isn't loaded), the error is logged and the consumer proceeds on as if nothing happened, happily consuming messages from the new partition. This will lead to data loss.

To avoid this, I am having to call sys.exit() if the ConsumerRebalanceListener encounters an error, which isn't exactly desirable. It would be better if the error was propagated up so I could deal with it normally. At the very least the assignment should fail so the consumer doesn't see any messages from the new partitions, and the rebalance can be reattempted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions