Repository navigation
fix(binding-mqtt-kafka): write a group offsets request as the kafka credit allows - #3272
Merged
jfallows merged 3 commits intoNov 17, 2026
Conversation
…credit An OffsetDelete request of 81 bytes plus padding must be written once the kafka peer grants enough credit, when the first window it grants is smaller than the request. The scenario fails against the current request stream, which sends once on the first window and skips the request when that window is too small. Refs #3271 Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SiHVoUxB2kGhP16gREH2uz
…redit allows The request stream of a group offsets reset built and sent its request once, on the first window, and skipped it when that window was smaller than the request. It now holds the request in an encode slot and writes as much as each window allows, with INIT on the first fragment and FIN on the last, as the kafka client api stream does for a request that does not fit the current window. It fails only when the stream ends, aborts or is reset before enough credit arrives. Fixes #3271 Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SiHVoUxB2kGhP16gREH2uz
…-offsets' into fix/3271-mqtt-kafka-request-stream-credit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The request stream of a group offsets reset (
KafkaApiRequestStream) built and sent its request once, on the first window, and skipped the request when that window was smaller than the request. A later, larger window did not help. For the OffsetDelete request (81 bytes plus padding) a first window of 67 bytes meant the delete was silently skipped.Credit is a contract in every direction: a sender with more to write than the window allows waits for the next window. The request stream now holds the request in an encode slot and writes as much as each window allows,
INITon the first fragment andFINon the last. It fails only when the stream ends, aborts or is reset before enough credit arrives.Pattern mirrored:
KafkaClientApiFactory.encodeNetinbinding-kafka(the consumer of this very stream), which writes up to the available credit minus padding, keeps the remainder inencodeSlotand flushes it on the next WINDOW. No reserve, slack or flag is added; the remaining length and the first fragment are derived fromencodeSlotOffset/encodeSlotLimit.Test evidence
session.close.expire.session.reset.group.offsets.small.window(kafka client/server pair): the kafka peer grants 67 bytes first, then 8192 on each stream.KafkaIT.shouldResetGroupOffsetsOnSessionExpiryAfterSmallWindow(spec pair): passes.MqttKafkaSessionProxyIT.shouldResetGroupOffsetsOnSessionExpiryAfterSmallWindow: fails before the change (the OffsetDelete stream is closed without its request being written), passes after../mvnw clean verifywith the build cache skipped:specs/binding-mqtt-kafka.spec291 tests (MqttIT 129, KafkaIT 162),runtime/binding-mqtt-kafka167 ITs plus 10 unit tests, all passing;checkstyle:checkandlicense:formatclean.Not delivered
Fixes #3271
Generated by Claude Code