Repository navigation
stream: propagate abort reason in share and broadcast - #63358
Merged
Merged
Conversation
Collaborator
|
Review requested:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #63358 +/- ##
==========================================
- Coverage 90.17% 90.13% -0.05%
==========================================
Files 718 718
Lines 227731 227923 +192
Branches 42768 42828 +60
==========================================
+ Hits 205365 205430 +65
- Misses 14145 14277 +132
+ Partials 8221 8216 -5
🚀 New features to boost your workflow:
|
trivikr
force-pushed
the
stream-iter-abort-signal
branch
from
May 17, 2026 23:37
bf6a9c3 to
0b2f09f
Compare
aduh95
reviewed
May 19, 2026
aduh95
reviewed
May 19, 2026
trivikr
force-pushed
the
stream-iter-abort-signal
branch
from
May 19, 2026 21:30
0b2f09f to
357819a
Compare
Pass signal.reason to the multi-consumer cancel paths so signal abort is reported as AbortError instead of clean iterator completion. Also make detached share consumers rethrow a stored source error when they resume after cancellation, preserving the abort reason for pending pulls. Fixes: nodejs#63357 Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.5
trivikr
force-pushed
the
stream-iter-abort-signal
branch
from
May 22, 2026 05:36
7cd59d9 to
5ebe6ed
Compare
jasnell
reviewed
May 22, 2026
jasnell
reviewed
May 22, 2026
aduh95
reviewed
May 22, 2026
aduh95
reviewed
May 22, 2026
aduh95
approved these changes
May 22, 2026
This updates
broadcast({ signal })andshare(source, { signal })topropagate
signal.reasonwhen the signal aborts.Previously, the abort handlers called
cancel()with no reason. Thatmade waiting consumers observe clean iterator completion instead of
rejecting with the signal's abort reason, which is an
AbortErrorforAbortController.abort().The Iterable Streams draft defines BroadcastOptions.signal and ShareOptions.signal,
and defines Broadcast.cancel(reason) such that consumers see an error when a reason
is provided and clean completion otherwise:
This change aligns
broadcast()andshare()with that behavior by callingcancel(signal.reason)on abort. It also ensures pendingshare()consumersthat resume after cancellation rethrow the stored source error instead of
converting it back into clean completion.
Fixes: #63357
Assisted-by: openai:gpt-5.5