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: make sure 'readable' is emitted before ending the stream #26059

Closed
wants to merge 3 commits into from

Conversation

mcollina
Copy link
Member

This change is born out of #25810, as I explored how to fix that difference.

This change could be considered semver-major or a bug fix. We need also to check some of the benchmarks if they are impacted before landing.

Fixes #25810

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

@nodejs-github-bot nodejs-github-bot added the stream Issues and PRs related to the stream subsystem. label Feb 12, 2019
const t = new stream.Transform({
transform: common.mustCall(function(chunk, encoding, callback) {
this.push(chunk);
return callback();
Copy link
Member

Choose a reason for hiding this comment

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

Nit that can be ignored, can we remove the return statement?

@mcollina
Copy link
Member Author

mcollina commented Mar 2, 2019

@jasnell
Copy link
Member

jasnell commented Mar 2, 2019

Still LGTM

@mcollina mcollina force-pushed the readable-next-tick branch from 833cb28 to c393c44 Compare March 4, 2019 15:29
@mcollina
Copy link
Member Author

mcollina commented Mar 4, 2019

Copy link
Member

@lpinca lpinca left a comment

Choose a reason for hiding this comment

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

This is what I mean, it saves a common.mustNotCall() call :)

test/parallel/test-stream-readable-emittedReadable.js Outdated Show resolved Hide resolved
test/parallel/test-stream-readable-emittedReadable.js Outdated Show resolved Hide resolved
lpinca and others added 2 commits March 5, 2019 16:57
Co-Authored-By: mcollina <matteo.collina@gmail.com>
Co-Authored-By: mcollina <matteo.collina@gmail.com>
@mcollina
Copy link
Member Author

mcollina commented Mar 5, 2019

I understand what you mean now!

CI: https://ci.nodejs.org/job/node-test-pull-request/21219/

@mcollina mcollina added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 5, 2019
@mcollina
Copy link
Member Author

mcollina commented Mar 6, 2019

Landed in e95e7f9

@mcollina mcollina closed this Mar 6, 2019
@mcollina mcollina deleted the readable-next-tick branch March 6, 2019 08:40
mcollina added a commit that referenced this pull request Mar 6, 2019
Fixes: #25810

PR-URL: #26059
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request Mar 12, 2019
Fixes: nodejs#25810

PR-URL: nodejs#26059
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
mcollina added a commit to mcollina/node that referenced this pull request Mar 13, 2019
In nodejs#26059, we introduced a bug that caused 'readable' to be nextTicked
on EOF of a ReadableStream. This breaks the dicer module on CITGM.
That change was partially reverted to still fix the bug in nodejs#25810 and
not break dicer.

See: nodejs#26059
Fixes: nodejs#25810
@BridgeAR
Copy link
Member

I marked this as do not land on all release lines and I'll back this out again from the release proposal for v11.12.0.

@mcollina
Copy link
Member Author

@BridgeAR this must land with 269103a.

mcollina added a commit that referenced this pull request Mar 16, 2019
In #26059, we introduced a bug that caused 'readable' to be nextTicked
on EOF of a ReadableStream. This breaks the dicer module on CITGM.
That change was partially reverted to still fix the bug in #25810 and
not break dicer.

See: #26059
Fixes: #25810

PR-URL: #26643
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit to targos/node that referenced this pull request Mar 27, 2019
Fixes: nodejs#25810

PR-URL: nodejs#26059
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
targos pushed a commit to targos/node that referenced this pull request Mar 27, 2019
In nodejs#26059, we introduced a bug that caused 'readable' to be nextTicked
on EOF of a ReadableStream. This breaks the dicer module on CITGM.
That change was partially reverted to still fix the bug in nodejs#25810 and
not break dicer.

See: nodejs#26059
Fixes: nodejs#25810

PR-URL: nodejs#26643
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this pull request Mar 27, 2019
Fixes: #25810

PR-URL: #26059
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
targos pushed a commit that referenced this pull request Mar 27, 2019
In #26059, we introduced a bug that caused 'readable' to be nextTicked
on EOF of a ReadableStream. This breaks the dicer module on CITGM.
That change was partially reverted to still fix the bug in #25810 and
not break dicer.

See: #26059
Fixes: #25810

PR-URL: #26643
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@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. stream Issues and PRs related to the stream subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transform stream misses final readable event for small inputs
7 participants