Skip to content

Run Process.run through one worker on Bun and Node - #1831

Merged
Lorenzobattistela merged 2 commits into
bendlang:mainfrom
oxura:fix/1468-node-process-worker-20261023
Oct 23, 2026
Merged

Lorenzobattistela merged 2 commits into
bendlang:mainfrom
oxura:fix/1468-node-process-worker-20261023

Conversation

@oxura

@oxura oxura commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Fixes #1468. Picks up the shared-worker direction from #1469, which was closed as stale.

Bun and Node use one node:worker_threads worker with child_process.spawn. There is no separate Node fallback. A child can leave stdin unread; its descendants cannot keep the input pipe hanging after it exits. The combined output cap kills the child as the bytes arrive.

Added the three stdin regressions from that review. Also checked the delayed touch case: cap 5 blocks the side effect, while the same script with a higher cap really creates the marker.

Local checks: all 22 cases pass on Bun 1.4.3, Node 22.23.1, interpreted Bend and native C. The fork/join pipe-isolation case passes on all three runtimes. Repo gate: 54/54. No mini-cluster run.

@Lorenzobattistela Lorenzobattistela self-assigned this Oct 23, 2026
Node's ChildProcess destroys proc.stdin when the child exits, so a
descendant that inherited stdin got at most one pipe buffer of input.
Hold stdin outside the ChildProcess and close it once the child has
exited and stdout and stderr have closed, as the C lane does.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Lorenzobattistela
Lorenzobattistela merged commit aee1b1f into bendlang:main Oct 23, 2026
1 check passed
@Lorenzobattistela Lorenzobattistela mentioned this pull request Oct 23, 2026
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.

Process.run ends the run on the Node host instead of running the program

2 participants