Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stream: propagate AbortSignal reason #55473

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

marvinroger
Copy link

This PR propagates the reason of the AbortSignal passed to the pipeline function (node:stream/promises) to the cause of the thrown AbortError.

The vast majority of AbortErrors created by the standard library already propagates the reason, so this should bring more consistency.

@nodejs-github-bot
Copy link
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 Oct 20, 2024
@benjamingr benjamingr added the request-ci Add this label to start a Jenkins CI on a PR. label Oct 20, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 20, 2024
@nodejs-github-bot
Copy link
Collaborator

@RedYetiDev
Copy link
Member

Thanks for the contribution! Unfortunately, your first commit doesn't follow the guidelines set in place. Could you amend it?

In this case, stream is the most appropriate subsystem. stream: ...

@marvinroger marvinroger force-pushed the feat/propagate-pipeline-abort-reason branch from 8feb3f6 to ed0d894 Compare October 20, 2024 17:58
@marvinroger
Copy link
Author

There you go @RedYetiDev! 😉

@RedYetiDev RedYetiDev added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels Oct 20, 2024
@marvinroger marvinroger changed the title pipeline: propagate AbortSignal reason stream: propagate AbortSignal reason Oct 20, 2024
@nodejs-github-bot
Copy link
Collaborator

Copy link

codecov bot commented Oct 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.40%. Comparing base (b0ffe9e) to head (ed0d894).
Report is 15 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #55473      +/-   ##
==========================================
- Coverage   88.42%   88.40%   -0.02%     
==========================================
  Files         653      653              
  Lines      187498   187498              
  Branches    36100    36108       +8     
==========================================
- Hits       165791   165762      -29     
- Misses      14957    14965       +8     
- Partials     6750     6771      +21     
Files with missing lines Coverage Δ
lib/internal/streams/pipeline.js 95.12% <100.00%> (ø)

... and 28 files with indirect coverage changes

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Can you add it to the docs as well?

@marvinroger
Copy link
Author

@mcollina I did not add it to the docs initially as it's the continuation of #41008, where no docs were updated, and it's now pretty much the expected behavior. greping the codebase reveals almost no instance of new AbortError() (except in streams, I'll do a follow up PR to fix the others, it's my first contribution and I wanted to see how it goes with a small PR). greping new AbortError(undefined, { cause: signal.reason reveals 33 results.

However, if you think it's still worth it to add it to the docs, I'll do!

@aduh95 aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. 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.