Skip to content

Add timeout to create process accepts - #41252

Merged
Feng Wang (chemwolf6922) merged 1 commit into
masterfrom
user/chemwolf6922/add-timeout-to-create-process-accepcts
Aug 6, 2026
Merged

Feng Wang (chemwolf6922) merged 1 commit into
masterfrom
user/chemwolf6922/add-timeout-to-create-process-accepcts

Conversation

@chemwolf6922

Copy link
Copy Markdown
Contributor

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:
image
Before the fix, the leaked processes live forever. After the fix, those processes exit after 30 seconds.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 the UtilAcceptVsock loop 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.

@OneBlue Blue (OneBlue) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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.

Session relay's vsock accept has no timeout; orphaned relays never exit, pinning vmbus rings until new sessions fail

3 participants