Skip to content

Conversation

@ronag
Copy link
Member

@ronagronag commented Jan 5, 2020

pipe() ondata should not control flow state if cleaned up.

Fixes: #31190

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

pipe() ondata should not control flow state if cleaned up. Fixes: nodejs#31190
@nodejs-github-botnodejs-github-bot added the stream Issues and PRs related to the stream subsystem. label Jan 5, 2020
@ronag
Copy link
MemberAuthor

ronag commented Jan 5, 2020

The problem here is that we call unpipe() and then resume(). resume() will schedule a resume_ in the next tick. However, before that a 'data' event is emitted causing ondata to explicitly pause the stream, which stops resume_ from re-flowing the stream.

Copy link
Member

@addaleaxaddaleax left a comment

Choose a reason for hiding this comment

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

LGTM if CI (and linter) are green

@ronagronagforce-pushed the stream-readable-unpipe-resume branch from 801fa99 to 786fcbbCompareJanuary 5, 2020 11:06
@ronagronagforce-pushed the stream-readable-unpipe-resume branch from 786fcbb to c9cd445CompareJanuary 5, 2020 11:07
@nodejs-github-bot
Copy link
Collaborator

@BridgeARBridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 6, 2020
Copy link
Member

@mcollinamcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@addaleax
Copy link
Member

Landed in b9e6c1b :)

@addaleaxaddaleax closed this Jan 7, 2020
addaleax pushed a commit that referenced this pull request Jan 7, 2020
pipe() ondata should not control flow state if cleaned up. Fixes: #31190 PR-URL: #31191 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Rich Trott <[email protected]>
MylesBorins pushed a commit that referenced this pull request Jan 16, 2020
pipe() ondata should not control flow state if cleaned up. Fixes: #31190 PR-URL: #31191 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Rich Trott <[email protected]>
@codebyterecodebytere mentioned this pull request Jan 16, 2020
@codebytere
Copy link
Member

@ronag this looks like it'll need a manual backport to v12.x, if we think it should land there. I'll add the label but feel free to swap it!

@ronag
Copy link
MemberAuthor

@codebytere: #32264

MylesBorins pushed a commit to MylesBorins/node that referenced this pull request Apr 1, 2020
pipe() ondata should not control flow state if cleaned up. Fixes: nodejs#31190 Backport-PR-URL: nodejs#32264 PR-URL: nodejs#31191 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Rich Trott <[email protected]>
ronag added a commit to nxtedition/node that referenced this pull request Apr 1, 2020
pipe() ondata should not control flow state if cleaned up. Fixes: nodejs#31190 PR-URL: nodejs#31191 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Rich Trott <[email protected]> Backport-PR-URL: nodejs#32264
MylesBorins pushed a commit that referenced this pull request Apr 1, 2020
pipe() ondata should not control flow state if cleaned up. Fixes: #31190 Backport-PR-URL: #32264 PR-URL: #31191 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Rich Trott <[email protected]> Backport-PR-URL: #32264
@codebyterecodebytere mentioned this pull request Apr 3, 2020
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.streamIssues and PRs related to the stream subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unpipe() and resume() in _transform()

9 participants

@ronag@nodejs-github-bot@addaleax@codebytere@mcollina@Trott@lpinca@MylesBorins@BridgeAR