Repository navigation
fix(binding-mqtt-kafka): act on session offsets fetch only once - #3119
Merged
Merged
Conversation
This was referenced Nov 11, 2026
Closed
The session offsets fetch stream can deliver the prior offsets record and then a caught-up flush. Each notification ran offset fetch completion, so a reconnect with an existing offsets record started a second producer init and a second offset commit stream. The first commit stream's window then triggered a write on the second, which had no credit, and the merged stream reset the session, surfacing as a CONNACK with reason code 0x8E. Offset fetch completion now runs once per session, keyed on the pending offset fetch stream. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SiHVoY2kh8WfqLyYj85hqP
jfallows
force-pushed
the
fix/3103-mqtt-kafka-offset-fetch-once
branch
from
November 17, 2026 01:21
b536f18 to
170a3f5
Compare
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
Reconnecting with a client id whose session offsets record already exists could fail the new connection with CONNACK reason code
0x8E(session taken over).Root cause. The session offsets fetch stream (
mqtt-sessions, key<client>#offsets) delivers the prior offsets record and then a caught-up flush. Both notifications ran offset fetch completion inMqttKafkaSessionFactory, so the session started a second producer init and a second offset commit stream. The first commit stream's WINDOW then triggered the offsets write on the second stream, which had no credit yet, so the merged kafka stream reset it. The reset carries no reason, which the mqtt server maps to0x8E.Fix. Offset fetch completion runs once per session, keyed on the pending offset fetch stream (the existing
offsetFetchfield), so later notifications from the same fetch stream are ignored.Test evidence.
session.qos2.offset.fetch.data.then.caught.up: k3po pair, spec-levelKafkaIT/MqttITmethods, and a runtimeMqttKafkaSessionProxyITmethod. The runtime IT failed before the fix (a second producer init stream is started) and passes after../mvnw clean verifyofspecs/binding-mqtt-kafka.specandruntime/binding-mqtt-kafkapasses, including checkstyle and license checks.examples/mqtt.kafka.proxyimage built from this branch, MQTT 5 raw client doing CONNECT, DISCONNECT, immediate CONNECT with the same client id. Clean Start 1, before: 5-14 of 100 reconnects got0x8E; after: 0 of 350 (plus 0 of 100 with Clean Start 0 and 0 of 50 with a 200 ms gap).Fixes #3103
Generated by Claude Code