Skip to content

fix(binding-kafka): wrap group assignment userdata at buffer start - #3292

Merged
jfallows merged 2 commits into
developfrom
fix/3288-kafka-group-assignment-overflow
Nov 16, 2026
Merged

jfallows merged 2 commits into
developfrom
fix/3288-kafka-group-assignment-overflow

Conversation

@jfallows

Copy link
Copy Markdown
Contributor

Description

KafkaClientGroupFactory builds the SyncGroup assignment userdata in a per-worker userdataBuffer. For each member it wrapped the shared assignmentTopicsUserdataRW builder at assignmentTopicsUserdataRW.limit(), which is the end of the previous build. The offset therefore only grew, across members and across SyncGroup requests handled by the same worker, until the fixed buffer (buffer.slot.capacity + 1 KiB = 33792 bytes by default) overflowed with IndexOutOfBoundsException and the engine stopped.

Each member's userdata is copied into extBuffer before the next member is built, so the builder is now wrapped at offset 0 for every member, as the same factory already does for topicPartitionsRW.wrap(extBuffer, 0, ...). Buffer size is unchanged.

The 33792 limit matches the report: one QoS 1 consumer group contributes about 84 bytes of userdata per SyncGroup, so roughly 400 groups on a worker reach the limit.

Tests (written first, commit a758c3e2f):

  • Scenario rebalance.assignment.userdata.repeated: five rebalance generations on one group stream, each assigning about 7 KiB of userdata. One generation fits the buffer; five accumulated do not.
  • ClientGroupIT.shouldAssignUserdataAcrossRepeatedRebalance runs it against the engine. On the unfixed code it fails with limit=35205 is beyond maxLimit=33792.
  • Spec-level GroupIT (application and network) run the client/server pair against each other.

Fixes #3288


Generated by Claude Code

Each SyncGroup member build wrapped the shared userdata builder at its
previous limit, so the offset only grew across requests on a worker until
the fixed buffer overflowed and stopped the engine. Wrap at 0 as each
member's userdata is copied out before the next is built.

Fixes #3288

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SiHVoTzEmnPYgqKSSa5qPx
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.

mqtt-kafka: engine crashes (IndexOutOfBoundsException in SyncGroup encode) after ~400 concurrent QoS 1 subscribers

2 participants