1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-23 15:16:54 -05:00
denoland-deno/ext/node/polyfills/internal
Nathan Whitaker cd59fc53a5
fix(node): Rework node:child_process IPC (#24763)
Fixes https://github.com/denoland/deno/issues/24756. Fixes
https://github.com/denoland/deno/issues/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
https://github.com/denoland/deno/issues/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
2024-07-30 16:13:24 -07:00
..
console refactor: Use virtul ops module (#22175) 2024-01-29 22:02:26 +01:00
crypto fix(ext/node): rewrite digest handling (#24392) 2024-07-05 10:10:22 +02:00
dns chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
fs fix(ext/node): Add fs.lutimes / fs.lutimesSync (#23172) 2024-07-02 19:33:32 -07:00
process refactor: use core.ensureFastOps() (#21888) 2024-01-10 15:37:25 -07:00
readline chore: upgrade to dprint 0.39 (#19768) 2023-07-08 18:34:08 +00:00
streams refactor: remove dead code in node stream polyfill (#23597) 2024-04-29 19:55:51 +09:00
test chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
util fix(ext/node): support NODE_DEBUG env (#23583) 2024-04-29 09:36:53 +00:00
assert.mjs refactor: rename InternalModuleLoader to ExtModuleLoader, use ext: scheme for snapshotted modules (#18041) 2023-03-08 12:44:54 +01:00
async_hooks.ts chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
blocklist.mjs feat(ext/node): add BlockList & SocketAddress classes (#24229) 2024-06-18 10:46:13 +00:00
buffer.d.ts chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
buffer.mjs perf(ext/node): improve Buffer from string performance (#24567) 2024-07-30 18:09:55 +05:30
child_process.ts fix(node): Rework node:child_process IPC (#24763) 2024-07-30 16:13:24 -07:00
cli_table.ts chore: sync up Node.js test files for v20.11.1 (#24066) 2024-06-11 11:41:44 +00:00
constants.ts refactor: use core.ensureFastOps() (#21888) 2024-01-10 15:37:25 -07:00
dgram.ts chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
dtrace.ts chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
error_codes.ts chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
errors.ts fix(node): Run node compat tests listed in the ignore field (and fix the ones that fail) (#24631) 2024-07-24 03:12:08 +00:00
event_target.mjs chore: upgrade to dprint 0.39 (#19768) 2023-07-08 18:34:08 +00:00
fixed_queue.ts fix(ext/node): make next tick queue resilient to Array.prototype tampering (#24361) 2024-06-27 21:45:46 +00:00
hide_stack_frames.ts chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
http.ts chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
idna.ts fix(ext/node): Match punycode module behavior to node (#22847) 2024-03-11 15:49:43 -07:00
net.ts chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
normalize_encoding.mjs chore(ext/node): disable prefer-primordials on a per-file basis (#19553) 2023-06-27 15:18:22 +09:00
options.ts chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
primordials.mjs feat(node): implement fs.statfs() (#22862) 2024-03-13 10:57:59 +00:00
querystring.ts chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
stream_base_commons.ts chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
timers.mjs fix(ext/node): spread args in setImmediate (#22998) 2024-03-20 07:52:50 +00:00
url.ts chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
util.mjs fix(ext/node): better support for node:diagnostics_channel module (#24088) 2024-06-15 00:07:02 +02:00
validators.mjs chore: sync up Node.js test files for v20.11.1 (#24066) 2024-06-11 11:41:44 +00:00