Skip to content

Keep round-robin member iteration consistent - #3202

Open
omrzk wants to merge 1 commit into
dpkp:masterfrom
omrzk:fix/roundrobin-member-identifiers
Open

omrzk wants to merge 1 commit into
dpkp:masterfrom
omrzk:fix/roundrobin-member-identifiers

Conversation

@omrzk

@omrzk omrzk commented Nov 20, 2026

Copy link
Copy Markdown

The round-robin assignor raises KeyError when it skips a consumer that does not subscribe to the current topic: the skip loop receives an (instance ID, member ID) tuple but uses it as a member ID. Its grouping step can also omit earlier static/dynamic runs when the join response interleaves membership types.

Sort the complete member list in the established static-first order, then cycle only member IDs. This preserves every member independently of input order and makes subscription skipping consistent with initial selection.

Fixes #3201. Tests cover differing subscriptions and all input permutations for dynamic/static/mixed membership, idle members, missing metadata, coordinator subscription decoding, and a JoinGroup/SyncGroup exchange through the existing MockBroker transport.

Validation: the final targeted selection has 22 failures and two passing controls on unchanged upstream; all 24 pass with the fix. All 560 consumer/coordinator tests pass on CPython 3.12 and 3.14; the full non-integration suite has 2,782 passes and one skip on 3.12. make lint, source/wheel build and diff checks pass. No live Kafka broker test was run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RoundRobinPartitionAssignor raises KeyError with multiple consumers in kafka-python 3.0.13

1 participant