Skip to content

stream: fix merge abort for pending sources#64013

Open
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:stream-iter-merge-abort-signal
Open

stream: fix merge abort for pending sources#64013
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:stream-iter-merge-abort-signal

Conversation

@trivikr

@trivikr trivikr commented Jun 19, 2026

Copy link
Copy Markdown
Member

Fixes: #64012

This fixes stream/iter merge() hanging when an abort signal fires while
the multi-source merge loop is waiting for pending source reads.

The change wakes the pending merge waiter on abort so the next read rejects
with AbortError. It also avoids awaiting iterator cleanup when the primary
error is the abort reason, since a source may already be stuck in a pending
next() call.


Assisted-by: openai:gpt-5.5

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/streams

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. stream Issues and PRs related to the stream subsystem. labels Jun 19, 2026
@trivikr trivikr force-pushed the stream-iter-merge-abort-signal branch from 655c543 to 315d0b2 Compare June 20, 2026 01:02
Wake the multi-source merge loop when its abort signal fires so a
pending read rejects instead of waiting for another source to settle.

When the primary error is the abort reason, do not await iterator
cleanup because sources may already be stuck in pending next() calls.

Fixes: nodejs#64012

Signed-off-by: Kamat, Trivikram <[email protected]>
Assisted-by: openai:gpt-5.5
@trivikr trivikr force-pushed the stream-iter-merge-abort-signal branch from 315d0b2 to 3e14c1a Compare June 20, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. stream Issues and PRs related to the stream subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stream/iter merge() can hang when aborted during pending multi-source read

2 participants