-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deno run
doesn't terminate when node:child_process.fork()
is used
#24756
Labels
Comments
Apparently, setting https://github.com/denoland/deno/blob/v1.45.4/ext/node/polyfills/child_process.ts#L145-L156 // spawn.mjs
import { spawn } from "node:child_process";
spawn("/bin/echo", ["hello"], { stdio: ["inherit", "inherit", "inherit"] });
// spawn_ipc.mjs
import { spawn } from "node:child_process";
spawn("/bin/echo", ["hello"], { stdio: ["inherit", "inherit", "inherit", "ipc"] });
|
I'm currently working on this - should have a PR to fix this (and some other child_process ipc related issues) soon |
crowlKats
pushed a commit
that referenced
this issue
Jul 31, 2024
Fixes #24756. Fixes #24796. This also gets vitest working when using [`--pool=forks`](https://vitest.dev/guide/improving-performance#pool) (which is the default as of vitest 2.0). Ref #23882. --- This PR resolves a handful of issues with child_process IPC. In particular: - We didn't support sending typed array views over IPC - Opening an IPC channel resulted in the event loop never exiting - Sending a `null` over IPC would terminate the channel - There was some UB in the read implementation (transmuting an `&[u8]` to `&mut [u8]`) - The `send` method wasn't returning anything, so there was no way to signal backpressure (this also resulted in the benchmark `child_process_ipc.mjs` being misleading, as it tried to respect backpressure. That gave node much worse results at larger message sizes, and gave us much worse results at smaller message sizes). - We weren't setting up the `channel` property on the `process` global (or on the `ChildProcess` object), and also didn't have a way to ref/unref the channel - Calling `kill` multiple times (or disconnecting the channel, then calling kill) would throw an error - Node couldn't spawn a deno subprocess and communicate with it over IPC (cherry picked from commit cd59fc5)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Versions
The text was updated successfully, but these errors were encountered: