Repository navigation
fix(binding-kafka): release waiting streams on the first refresh or when the last meta stream is gone - #3276
Merged
jfallows merged 3 commits intoNov 17, 2026
Conversation
…last meta stream closes A raw API request stream addressed to a broker id the route's table does not know waits for a Metadata refresh before it is answered with the existing reset. When the only meta stream on the route is closed by its own application, either with END or with ABORT, while that refresh is in flight, the waiting stream must still be answered; it is not, so the scripts below fail until the route releases waiters once its last meta stream has unregistered. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SiHVoVCAexPDhCJ4HBPixy
…5-kafka-meta-refresh-failure-scope
…when the last meta stream is gone A stream waiting for a broker table refresh was released by the first completion or failure of any meta stream on the route, so a failure of a meta stream that was not carrying the refresh reset the waiting stream before its own refresh had finished, and a waiting stream was never released when the last meta stream was closed by its own application with END or ABORT. The route now decides the release in one place. A meta stream that unregisters releases the waiting streams only when no meta stream remains registered on the route, and a successful refresh releases them as before. A failure of one of several meta streams no longer releases them. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SiHVoVCAexPDhCJ4HBPixy
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
A raw API request stream addressed to a broker id that the route's table does not know waits for a Metadata refresh and is then answered with the existing reset. Until now the route released the waiting streams on the first completion or failure of any meta stream on the route. That has two consequences:
The route now decides the release in one place.
KafkaClientRoute.unregisterMetaFlushremoves the meta stream and releases the waiting streams only when no meta stream remains registered on the route (hasMeta()). A successful refresh releases them as before, andcleanupApplicationno longer releases them itself. A failure of one of several meta streams therefore no longer releases them.No existing pattern in the module does this; placing the release decision in the route's unregister is a design choice made for this issue.
What stays unchanged
Tests
The first commit (5d786a3) adds two scenarios to the existing
KafkaCreateTopicsITclasses, with paired application and network scripts:create.topics.v7.broker.unknown.refresh.meta.abortedandcreate.topics.v7.broker.unknown.refresh.meta.ended. The last meta stream on the route is closed by its own application with ABORT or END while an API stream to an unknown broker id is waiting, and the API stream must then be reset. On the unmodified binding they fail only because that reset never arrives; with the change they pass.clean verifyofspecs/binding-kafka.specandruntime/binding-kafkawith the module checks on and the build cache skipped: both modules build successfully, with no failures or errors in the unit tests (226 and 229) or the spec and runtime ITs (490 and 465 run, 12 and 67 skipped).Exception to the test-first rule
The case where one of several meta streams fails while another carries the refresh has no failing test, by the maintainer's explicit decision. No k3po script can fail before the change: k3po buffers an event that arrives early at a
read awaitbarrier, and it cannot assert the order of two frames on different streams (the waiting stream's reset and the refreshed data on the other meta stream), which is the only difference between the old and the new behaviour. That case is therefore not covered by a failing test.Stacking
This branch is stacked on
test/3254-kafka-api-meta-refresh-coverageand is based on it.Fixes #3255
Generated by Claude Code