orchestrator-process: fix TCP proxy#35008
Merged
teskje merged 1 commit intoMaterializeInc:mainfrom Feb 16, 2026
Merged
Conversation
This fixes a bug in the use of `select!` in the process orchestrator's TCP proxy. The select has two branches, an accept branch that accepts new TCP connections and appends them to a `FuturesUnordered`, and a driver branch that drives the `FuturesUnordered`. The driver branch had a `Some(Err(e))` match pattern, to print a warning on errors. On pattern mismatch, e.g., if one of the connection futures completed successfully, the `select!` macro doesn't complete but continues polling the remaining branches, i.e. the accept branch. This means we can get into a state where the macro only waits for new connection requests, but doesn't drive forward existing connections anymore. Existing connections will hang until a new connection is accepted, completing the `select!`. The fix is to not do the `Err` matching in the `select!` macro, but in the handler body instead.
Pre-merge checklist
|
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.
This fixes a bug in the use of
select!in the process orchestrator's TCP proxy. The select has two branches, an accept branch that accepts new TCP connections and appends them to aFuturesUnordered, and a driver branch that drives theFuturesUnordered. The driver branch had aSome(Err(e))match pattern, to print a warning on errors.On pattern mismatch, e.g., if one of the connection futures completed successfully, the
select!macro doesn't complete but continues polling the remaining branches, i.e. the accept branch. This means we can get into a state where the macro only waits for new connection requests, but doesn't drive forward existing connections anymore. Existing connections will hang until a new connection is accepted, completing theselect!.The fix is to not do the
Errmatching in theselect!macro, but in the handler body instead.