Repository navigation
Add timeout to create process accepts - #41252
Feng Wang (chemwolf6922) merged 1 commit into
Conversation
There was a problem hiding this comment.
🟢 Ready to approve
The change is minimal, uses an existing timeout constant already relied on by other accept paths, and directly addresses the reported indefinite-blocking leak scenario.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Pull request overview
This PR bounds the relay-side vsock accept calls during Utility VM process creation so that partial connection setup on the Windows side doesn’t leave the Linux relay blocked indefinitely, preventing leaked relay processes and pinned hv socket resources.
Changes:
- Apply
SESSION_LEADER_ACCEPT_TIMEOUT_MS(30s) to theUtilAcceptVsockloop that accepts the create-process socket set. - Ensure relay exits on timeout/failure instead of blocking forever on
accept.
File summaries
| File | Description |
|---|---|
| src/linux/init/init.cpp | Adds a 30s timeout to vsock accepts in the create-process relay path to prevent indefinite blocking/leaks. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
Blue (OneBlue)
left a comment
There was a problem hiding this comment.
For a long time there's been an issue where things get stuck missing a socket in this loop, and we've specifically left this on to help root cause that issue, but sadly we never went to the bottom of it.
At this point it's probably worth fixing this. We can always revert if we see another repro of the hanging accept in this code path
Summary of the Pull Request
When creating a process, if the Windows side fails to create all 5/6 connections, the Linux side will block forever at accept. This leaks relay processes and hv socket connections.
This PR applies a 30s timeout to the accept calls to allow the process to exit on potential failure.
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed
Manually tested by injecting a failure after the first connect call:

Before the fix, the leaked processes live forever. After the fix, those processes exit after 30 seconds.