Skip to content

stream: honor AbortSignal in Writer.end()#64727

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

stream: honor AbortSignal in Writer.end()#64727
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:stream-iter-writer-end-abort-signal

Conversation

@trivikr

@trivikr trivikr commented Jul 25, 2026

Copy link
Copy Markdown
Member

Fixes: #64726

This change makes end() reject with signal.reason when passed a
pre-aborted signal, without closing the writer. For push writers, aborting
the signal while buffered data is draining rejects that end() operation
while allowing the underlying graceful close to continue.


Assisted-by: codex:gpt-5.6-sol

Reject Writer.end() when its signal is already aborted without
closing the writer. For push writers, reject the pending operation
if the signal aborts while buffered data drains, while allowing the
graceful close to continue.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: codex:gpt-5.6-sol
@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 Jul 25, 2026
@codecov

codecov Bot commented Jul 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.10526% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.15%. Comparing base (b420cb6) to head (849b419).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/streams/iter/push.js 91.42% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #64727      +/-   ##
==========================================
+ Coverage   90.13%   90.15%   +0.01%     
==========================================
  Files         743      743              
  Lines      242412   242440      +28     
  Branches    45655    45660       +5     
==========================================
+ Hits       218510   218568      +58     
+ Misses      15403    15391      -12     
+ Partials     8499     8481      -18     
Files with missing lines Coverage Δ
lib/internal/streams/iter/broadcast.js 87.75% <100.00%> (+0.01%) ⬆️
lib/internal/streams/iter/push.js 91.42% <91.42%> (+0.50%) ⬆️

... and 37 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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: Writer.end() ignores AbortSignal

2 participants