Files
node/test/parallel
Matteo Collina d56c163922 stream: keep async context of pipeTo watchers
The ClosedPromiseHook records that pipeTo() and tee() install as the
[[closedPromise]] of their reader and writer enqueued the watcher from
whoever settled the record. The source-closed, source-errored and
dest-errored steps of pipeTo() therefore ran in the async context of
the code that closed or errored the stream, so the destination's
close() and abort() and the source's cancel() observed the wrong
AsyncLocalStorage store. Capture the async context frame when the
hook is installed and register the reaction in it, as the spec's
promise reaction would.

Add a test that records the context each underlying source, sink and
transformer callback observes across readable, writable, transform,
pipe and tee scenarios, so scheduling shortcuts that drop the context
are caught.

Refs: https://github.com/nodejs/node/issues/66906
Refs: https://github.com/nodejs/node/pull/66424
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/67052
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2026-10-29 11:53:26 +00:00
..
2026-10-24 19:17:24 +00:00
2026-10-19 02:34:09 +00:00
2026-10-19 02:34:09 +00:00
2026-10-19 02:34:09 +00:00
2026-10-15 00:52:34 +00:00
2026-10-15 00:52:34 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-19 02:34:09 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-20 12:33:08 +00:00