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

Revert 5541300 and add coverage to pipeline #56278

Closed
wants to merge 2 commits into from

Conversation

jakecastelli
Copy link
Member

@jakecastelli jakecastelli commented Dec 17, 2024

#55096 introduced a regression which causes the callback in the pipeline not called when error is thrown in read from readable. Please note this is on the current main not released yet.

I think this would cause a massive breakage as I found this out through some user land applications / packages by using the nightly build. My suggestion is:

  1. revert 5541300 (as it currently causes regression on nightly build)
  2. adding a test coverage / some test coverages
  3. let the origin author to reopen a PR and we run a CITGM to see if there are more potential breakages

Take this code snippet as repro:

const { Readable, pipeline, Duplex, Writable } = require("node:stream");

async function* myAsyncGenerator(ag) {
  for await (const data of ag) {
    yield data;
  }
}

const duplexStream = Duplex.from(myAsyncGenerator);

const r = new Readable({
  read() {
    this.push("data1\n");
    throw new Error("booom");
  },
});

const w = new Writable({
  write(chunk, encoding, callback) {
    callback();
  },
});

pipeline(r, duplexStream, w, (err) => {
  console.log("Error in pipeline:", err); // you won't be able to see this line as the cb never get called
});

This PR reverted 5541300 and added a new test coverage.

cc @matthieusieben

jakecastelli and others added 2 commits December 17, 2024 15:12
@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 Dec 17, 2024
@jakecastelli jakecastelli added commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. stream Issues and PRs related to the stream subsystem. needs-ci PRs that need a full CI run. and removed stream Issues and PRs related to the stream subsystem. needs-ci PRs that need a full CI run. labels Dec 17, 2024
Copy link

codecov bot commented Dec 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.54%. Comparing base (80e3ef3) to head (175b3aa).
Report is 43 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #56278      +/-   ##
==========================================
- Coverage   88.55%   88.54%   -0.01%     
==========================================
  Files         657      657              
  Lines      190265   190220      -45     
  Branches    36541    36534       -7     
==========================================
- Hits       168483   168430      -53     
- Misses      14970    14971       +1     
- Partials     6812     6819       +7     
Files with missing lines Coverage Δ
lib/internal/streams/duplexify.js 96.56% <100.00%> (-0.60%) ⬇️

... and 24 files with indirect coverage changes

@jakecastelli jakecastelli added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 17, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 17, 2024
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@matthieusieben
Copy link
Contributor

matthieusieben commented Dec 17, 2024

Isn't this due to the fact that autoDestroy is not set in the readable options ?

apparently not.

@matthieusieben
Copy link
Contributor

matthieusieben commented Dec 17, 2024

I adressed this issue in #56287. Streams are hard 😅

@jakecastelli
Copy link
Member Author

Can we get this landed first?

First this is breaking on nightly.
Second, @matthieusieben can take time to work on opening a new PR with the origin change and his fix in #56287 in a single commit and we run CITGM. What do you folks think?

This PR is ready with a green CI. cc @nodejs/streams

@matthieusieben
Copy link
Contributor

I agree that this is probably the best course of action

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

@mcollina
Copy link
Member

@matthieusieben @nodejs/streams may i get another LGTM so we can land?

@jakecastelli jakecastelli added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 23, 2024
@mcollina mcollina added the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 24, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 24, 2024
@nodejs-github-bot
Copy link
Collaborator

Landed in a9e65f6...5ea6fa7

nodejs-github-bot pushed a commit that referenced this pull request Dec 24, 2024
This reverts commit 5541300.

PR-URL: #56278
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
nodejs-github-bot pushed a commit that referenced this pull request Dec 24, 2024
co-authored-by: jazelly <xzha4350@gmail.com>
PR-URL: #56278
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
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-rebase Add this label to allow the Commit Queue to land a PR in several commits. 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.

4 participants