fix(supervisor-client): open a fresh connection per request - #1412
Merged
Merged
Conversation
Since 0828cb4 the shared Unix-socket client keeps idle connections for up to 90s, while the supervisor closes an idle keep-alive connection after 15s. A VMM request that picks up a pooled connection as the supervisor closes it fails with EPIPE, surfacing as a GetInfo error. Local socket connects are cheap, so go back to one connection per request. Signed-off-by: Kevin Wang <wy721@qq.com>
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.
Since 0828cb4 the shared Unix-socket HTTP client pools idle connections for up to 90s, but the supervisor closes an idle keep-alive connection after 15s. When the VMM reuses a pooled connection just as the supervisor closes it, the request fails with
error writing a body to connection: Broken pipe (os error 32), which surfaces to callers such asVmm.GetInfo(vmm-cli info).Use
ConnectionReuse::Freshfor supervisor requests, restoring the pre-0828cb45df behavior; a local socket connect is cheap.Found by the PR 841 acceptance suite (
tc-kms-upgrade-010, intermittent on physical TDX).Verification
cargo clippy -p supervisor-client -- -D warningsandcargo build -p dstack-vmmare clean.