Repository navigation
fix(binding-kafka): recover produce and fetch when a broker connection is lost - #2616
Merged
jfallows merged 5 commits intoSep 29, 2026
Merged
Conversation
When a produce or fetch connection to a broker ends, aborts or resets, the client streams cleaned up without refreshing metadata. Cached partition leaders kept pointing at the departed broker until the next scheduled metadata refresh, so reconnects targeted the same broker. Trigger an immediate metadata refresh from the network end, abort and reset handlers of the client produce and fetch streams, reusing the existing metaFlush hook used for retriable error codes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
When a produce connection to a broker aborted or reset, the client produce stream reset the application stream without an error code. The cache treated this as a non-retriable unknown error and failed the pending records, instead of reconnecting and resending them as it does for other retriable errors. Report NETWORK_EXCEPTION on network abort or reset in the client produce stream, and handle it in the cache server produce fanout the same way as NOT_LEADER_FOR_PARTITION, so the cache client reconnects and resends the pending records. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ode buffer The produce client credits the application window per record as value size plus a fixed framing padding, but a record's key and headers are encoded into the same buffer slot. When key and headers exceed the padding and records accumulate while a produce request is in flight, the encoded records overrun the encode slot. - raise the advertised window padding once a record's framing (batch, record header, key and headers) exceeds the configured framing size - size the pre-encode capacity check from the current record instead of the previous record's value size - reset the stream rather than write past the encode slot when a record cannot fit Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ivery The cache server acknowledged every entry up to the latest offset signaled by the cache client whenever the produce client stream was fully acknowledged, including entries not yet sent or still in flight. If the in-flight produce request then failed with a retriable error, those entries were already marked complete, so they were skipped on reconnect and never produced, while the producer had already been told they succeeded. Acknowledge success only up to the last entry delivered by the cursor, and defer the acknowledgement when skipping a completed entry until all in-flight data has been acknowledged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
jfallows
requested changes
Sep 28, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
jfallows
approved these changes
Sep 29, 2026
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.
No description provided.