Skip to content

fix(supervisor-client): open a fresh connection per request - #1412

Merged
kvinwang merged 1 commit into
nextfrom
fix/supervisor-client-fresh-connection
Sep 26, 2026
Merged

kvinwang merged 1 commit into
nextfrom
fix/supervisor-client-fresh-connection

Conversation

@kvinwang

Copy link
Copy Markdown
Collaborator

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 as Vmm.GetInfo (vmm-cli info).

Use ConnectionReuse::Fresh for 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

  • Reproduced the close timing against the supervisor binary: an idle keep-alive connection is closed after exactly 15.0s and the next write fails with EPIPE.
  • cargo clippy -p supervisor-client -- -D warnings and cargo build -p dstack-vmm are clean.

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>
@kvinwang
kvinwang merged commit 86ec5ed into next Sep 26, 2026
11 checks passed
@kvinwang
kvinwang deleted the fix/supervisor-client-fresh-connection branch September 26, 2026 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant