Repository navigation
adapter: fix unknown-connection panic on abandoned failed startup - #37988
Merged
Merged
Conversation
The cleanup guard in Client::startup sent a Terminate command whenever the startup response was left unobserved, including when it was an error. A failed startup never registers the connection in active_conns, so the Coordinator panicked on such a Terminate with "unknown connection" (incident-1183). Send Terminate only for an unobserved successful startup, document the no-state-on-failed-startup invariant, and extend test_concurrent_id_reuse (renamed to test_termination_races) with a deterministic regression test. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_018fo6yH9ymTx8Fwnfa5JpUt
SangJunBak
approved these changes
Jul 31, 2026
SangJunBak
left a comment
Contributor
There was a problem hiding this comment.
LGTM! Thanks for the test!
bosconi
pushed a commit
that referenced
this pull request
Aug 4, 2026
Adds the rc.2 increment to the v26.36.0 section of the releases index: one bug fix (#37988), a coordinator panic when a client abandoned a connection attempt that had already failed. Dates are unchanged — the provisional Cloud 2026-08-06 / Self-Managed 2026-08-07 pair is still the first Thursday strictly after the rc.1 tag commit, so the operator-compatibility YAML needs no edit this snapshot.
ggevay
pushed a commit
that referenced
this pull request
Aug 19, 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.
Motivation
Fixes a Coordinator panic seen in incident-1183 (https://materializeinc.slack.com/archives/C0BLZBH1SEA):
A connection is registered in
active_connsonly when startup succeeds. The cleanup guard inClient::startupsent aTerminatecommand whenever the startup response was left unobserved, including when it was an error, which happens when a client abandons a startup that failed (realistically via the HTTP endpoint, whose handler futures are dropped when the client disconnects or times out). The Coordinator then hit the "unknown connection" assertion inhandle_terminateand aborted.The fix sends
Terminateonly when the unobserved response was a successful startup. A failed startup leaves no per-connection state anywhere in the Coordinator, so there is nothing to clean up. This invariant is now documented onhandle_startup_inner, and the related comments on the startup error path,handle_terminate, and theCommand::Startupdispatch site state it as well.Testing
test_concurrent_id_reuse(renamed totest_termination_races, nextest override updated) with a deterministic second phase on the same server: it abandons a failed startup and asserts the Coordinator survives. Without the fix, the phase fails with the exact production panic. It adds no measurable runtime to the test.environmentd::Servernow exposes the adapter client for tests, gated behind thetestfeature.🤖 Generated with Claude Code