Skip to content

fix: cross-spawn close event hang when grandchild inherits stdio - #43511

Closed
amathur2k wants to merge 1 commit into
anomalyco:devfrom
amathur2k:windows-stdio-hang
Closed

fix: cross-spawn close event hang when grandchild inherits stdio#43511
amathur2k wants to merge 1 commit into
anomalyco:devfrom
amathur2k:windows-stdio-hang

Conversation

@amathur2k

Copy link
Copy Markdown

Summary

On Windows, the bash tool blocked until its timeout whenever a spawned grandchild process kept the inherited stdout/stderr pipe open (dev servers, daemons). The spawner waited on the close event, which never fires when a detached grandchild inherits the stdio fds (no EOF). It now falls back to the exit result after a short grace period so the process result still resolves.

I have tested that it removes the fix.

Fixes#32504

The spawner waited on the "close" event, but on Windows (Start-Process)
and POSIX (backgrounded `cmd &`) a detached grandchild can inherit the
parent's stdio pipes, so "close" never fires because the fds never see
EOF. Fall back to the "exit" result after a short grace period so the
process result still resolves.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SmZQhupC6te7razRpvz3gZ
@github-actionsgithub-actionsBot added the needs:compliance This means the issue will auto-close after 2 hours. label Aug 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potential Duplicate Found:

You should check if #42756 is already merged or if it addresses the same issue differently before proceeding with #43511.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actionsgithub-actionsBot removed the needs:compliance This means the issue will auto-close after 2 hours. label Aug 19, 2026
Sign up for freeto 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.

Bash tool hangs until timeout on Windows when spawned process keeps a stdout/stderr pipe open (dev servers, daemons)

1 participant

@amathur2k