Skip to content

[v14.x backport] stream: simpler and faster Readable async iterator - #34887

Closed
ronag wants to merge 6 commits into
nodejs:v14.x-stagingfrom
nxtedition:backport-34035-to-v14.x
Closed

[v14.x backport] stream: simpler and faster Readable async iterator #34887
ronag wants to merge 6 commits into
nodejs:v14.x-stagingfrom
nxtedition:backport-34035-to-v14.x

Conversation

@ronag

@ronagronag commented Aug 23, 2020

Copy link
Copy Markdown
Member

A backport of semver-major labelled PR. Was discussed with TSC who gave a go ahead to open a PR and try to gain approval from collaborators.

PR: #34035
Refs: #34680

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Writable stream could emit 'finish' after 'close'.

PR-URL: #32933
Reviewed-By: Luigi Pinca luigipinca@gmail.com
Reviewed-By: Matteo Collina matteo.collina@gmail.com

@ronagronag added the stream Issues and PRs related to the stream subsystem. label Aug 23, 2020
@nodejs-github-botnodejs-github-bot added build Issues and PRs related to build files or the CI. v14.x labels Aug 23, 2020
@ronag
ronagforce-pushed the backport-34035-to-v14.x branch from 91ba1df to 8fecd44CompareAugust 23, 2020 10:02
@ronagronag changed the title stream: don't emit finish after close[v14.x backport] stream: don't emit finish after closeAug 23, 2020
@nodejs-github-bot

This comment has been minimized.

@ronagronag changed the title [v14.x backport] stream: don't emit finish after close[v14.x backport] stream: simpler and faster Readable async iterator Aug 23, 2020
@ronag
ronagforce-pushed the backport-34035-to-v14.x branch from 8fecd44 to 6c942b0CompareAugust 23, 2020 10:07
@ronag

ronag commented Aug 23, 2020

Copy link
Copy Markdown
MemberAuthor

This has a dependency on #34103 which I had to include.

@ronag

Copy link
Copy Markdown
MemberAuthor

@MylesBorins There are two backports in this PR. Would I need to open separate PRs? The first commit doesn't make much sense to backport without the second one.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@ronag

Copy link
Copy Markdown
MemberAuthor

Weird test failure? AssertionError [ERR_ASSERTION]: benchmark file not running exactly one configuration in test:?

@mcollinamcollina added the tsc-agenda Issues and PRs to discuss during the meetings of the TSC. label Aug 23, 2020

@mcollinamcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm - I think this is the right thing to do long term.

@ronag

ronag commented Sep 1, 2020

Copy link
Copy Markdown
MemberAuthor

@nodejs/streams

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@richardlau

Copy link
Copy Markdown
Member

Weird test failure? AssertionError [ERR_ASSERTION]: benchmark file not running exactly one configuration in test:?

We're still seeing this in the CI on multiple platforms. Anyone able to take a look please?

@ronag

ronag commented Sep 3, 2020

Copy link
Copy Markdown
MemberAuthor

Anyone able to take a look please?

Who can help with that? I have no clue.

@mhdawson

Copy link
Copy Markdown
Member

Discussed in TSC meeting today, no objections raised by TSC members that were there. Myles, sees Matteo chiming that it is a good thing so comfortable that it land given that stream subsystem team members are signing off once ci is green. Removing the agenda tag.

@mhdawsonmhdawson removed the tsc-agenda Issues and PRs to discuss during the meetings of the TSC. label Sep 3, 2020
@lundibundi

lundibundi commented Sep 3, 2020

Copy link
Copy Markdown
Member

Who can help with that? I have no clue.

@ronag I think you have to force a single configuration for your benchmark test in the test/benchmark/test-benchmark-streams.js
(see example in test/benchmark/test-benchmark-policy.js)

This is not the case since #31755.

@ronag
ronag requested a review from mcollinaOctober 14, 2020 10:19
Comment threadlib/_stream_readable.js
@ronagronag added the request-ci Add this label to start a Jenkins CI on a PR. label Oct 14, 2020
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 14, 2020
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@ronag
ronag requested a review from lpincaOctober 14, 2020 10:49
ronag added a commit to nxtedition/node that referenced this pull request Oct 14, 2020
Fixes some compatibility issues where it is expected
that for await stops reading when the stream is
destroyed.
Refs: nodejs#34887
@ronag

Copy link
Copy Markdown
MemberAuthor

This needs some more collaborator review to ensure we are confident with landing it in 14.x.

@BethGriggs

Copy link
Copy Markdown
Member

Just FYI in case it shows up in this PR, it looks like test-asan is failing on v14.x, i'm trying to figure that out in #35641.

@ronag

ronag commented Oct 14, 2020

Copy link
Copy Markdown
MemberAuthor

@BethGriggs Green CI. Just needs another approval or two. Thanks for the ping!

@mcollina

Copy link
Copy Markdown
Member

What are the commits that are backported here? Have we got a references to those two PRs?

@ronag

ronag commented Oct 14, 2020

Copy link
Copy Markdown
MemberAuthor

Yea I seem to have ruined the commit msg. The backported PR's are:

#34035
#35122

Also relevant:

#35640

@MylesBorins

Copy link
Copy Markdown
Contributor

@ronag it seems like multipel prs + commits have all merged into one here. I'm assuming that it will be a lot of work to split them up... so in lieu of that I think we could treat this as an entirely new change that avoids needing to backport the other change.

That does mean we will need at least 2 signoff before landing this.

@mcollinamcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@mcollina

Copy link
Copy Markdown
Member

what is the diff vs what we have on master?

@ronag

ronag commented Oct 14, 2020

Copy link
Copy Markdown
MemberAuthor

what is the diff vs what we have on master?

Once #35640 is merged, I believe they are exactly the same.

@MylesBorins

MylesBorins commented Oct 14, 2020

Copy link
Copy Markdown
Contributor

@mcollina@ronag . Should we rush getting this into the next 14? it will be the last release before LTS, planned to go out tomorrow

#35648

I'll be honest, considering these changes caused issues in the past I'm a bit nervous about including them just before flipping the LTS bit, but perhaps I am being too conservative. What do y'all think?

@mcollina

Copy link
Copy Markdown
Member

I think we would like to have this in v14 to simplify backporting.

@BethGriggs

Copy link
Copy Markdown
Member

I'll be honest, considering these changes caused issues in the past I'm a bit nervous about including them just before flipping the LTS bit, but perhaps I am being too conservative. What do y'all think?

FWIW, i'm somewhat leaning the opposite way, and feel that (for the same reasons) this change should land before v14.x is promoted to LTS. (Assuming that CITGM is happy.)

@MylesBorins

Copy link
Copy Markdown
Contributor

@ronag would you be able to rebase so we can make sure the asan test isn't broken by this PR

@MylesBorins

Copy link
Copy Markdown
Contributor

@nodejs/streams we still need 1 more sign off on this

@MylesBorins

Copy link
Copy Markdown
Contributor

I'm 99% sure the test failure here was broken on 14.x before this was opened and the PR just needs a rebase. I'm going to land this as soon as #35640 lands

MylesBorins pushed a commit that referenced this pull request Oct 15, 2020
Fixes some compatibility issues where it is expected
that for await stops reading when the stream is
destroyed.
Refs: #34887
PR-URL: #35640
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Oct 15, 2020
includes:
* stream: simpler and faster Readable async iterator
* stream: don't destroy on async iterator success
* stream: async iterator stop read if destroyed
PR-URL: #34887
Refs: #34035
Refs: #35122
Refs: #35640
Refs: #34680
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
@MylesBorins

MylesBorins commented Oct 15, 2020

Copy link
Copy Markdown
Contributor

Landed in 573410f

Hopefully I captures things accurately in the commit message

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver-minorPRs that contain new features and should be released in the next minor version.streamIssues and PRs related to the stream subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

11 participants

@ronag@nodejs-github-bot@richardlau@mhdawson@lundibundi@mcollina@wa-Nadoo@BethGriggs@MylesBorins@lpinca@vweevers