Skip to content

fix(core): resolve child process exit signal on exit event - #42275

Open
vladislav-miroshnikov wants to merge 2 commits into
anomalyco:devfrom
vladislav-miroshnikov:bootstrap-exit-reap
Open

fix(core): resolve child process exit signal on exit event#42275
vladislav-miroshnikov wants to merge 2 commits into
anomalyco:devfrom
vladislav-miroshnikov:bootstrap-exit-reap

Conversation

@vladislav-miroshnikov

@vladislav-miroshnikovvladislav-miroshnikov commented Aug 13, 2026

Copy link
Copy Markdown

Issue for this PR

Fixes#41806

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

ChildProcessHandle.exitCode was settled from Node's close event, which waits for stdio to close after the direct child exits. A descendant that inherits one of those pipes can therefore keep the direct child's exit signal pending.

This settles the signal from exit instead and retains close as a fallback. The change is intentionally limited to the handle lifecycle; callers that separately collect streams continue to wait for stream completion.

How did you verify your code works?

  • cd packages/core && bun test test/effect/cross-spawn-spawner.test.ts — 25 pass, 0 fail
  • cd packages/core && bun typecheck

The regression starts a parent that spawns a descendant with inherited stdout, records readiness, and exits. The descendant holds the pipe open until the test releases it, proving that exitCode settles from the direct child's exit rather than the later stream close.

Screenshots / recordings

N/A — no UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

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.

Instance bootstrap hangs forever (Linux): spawned git child exits but is never reaped — TUI renders, but Enter can never start a session

1 participant

@vladislav-miroshnikov