stream: fix readable being emitted when nothing to do#18372
Closed
mafintosh wants to merge 1 commit intonodejs:masterfrom
Closed
stream: fix readable being emitted when nothing to do#18372mafintosh wants to merge 1 commit intonodejs:masterfrom
mafintosh wants to merge 1 commit intonodejs:masterfrom
Conversation
Member
Author
|
/cc @mcollina @nodejs/streams |
jasnell
approved these changes
Jan 26, 2018
3bb3f96 to
613b68e
Compare
Member
|
CITGM (master): https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/1239/ (before landing) |
Member
|
CITGM seems similar to master, landing. |
Member
|
Landed as 0778f79. |
MoonBall
pushed a commit
to MoonBall/node
that referenced
this pull request
Feb 5, 2018
The original test case hides the underlying cause by using `PassThrough`. This change adds a test case for the underlying cause. This makes it clearer and easier to be understood. Refs: nodejs#18372
3 tasks
MayaLekova
pushed a commit
to MayaLekova/node
that referenced
this pull request
May 8, 2018
Fixes a regression introduced by the once-per-microtick 'readable' event emission. See: nodejs#17979 PR-URL: nodejs#18372 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
MayaLekova
pushed a commit
to MayaLekova/node
that referenced
this pull request
May 8, 2018
The original test case hides the underlying cause by using `PassThrough`. This change adds a test case for the underlying cause. This makes it clearer and easier to be understood. Refs: nodejs#18372 PR-URL: nodejs#18575 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
4 tasks
lundibundi
added a commit
to lundibundi/node
that referenced
this pull request
Aug 10, 2018
Avoid trying to emit 'readable' due to the fact that
state.length is always >= state.highWaterMark if highWaterMark is 0.
Therefore upon .read(0) call (through .on('readable')) stream assumed
that it has enough data to emit 'readable' even though
state.length === 0 instead of issuing _read(). Which led to the TTY
not recognizing that someone is waiting for the input.
Fixes: nodejs#20503
Refs: nodejs#18372
mcollina
pushed a commit
that referenced
this pull request
Aug 10, 2018
Avoid trying to emit 'readable' due to the fact that
state.length is always >= state.highWaterMark if highWaterMark is 0.
Therefore upon .read(0) call (through .on('readable')) stream assumed
that it has enough data to emit 'readable' even though
state.length === 0 instead of issuing _read(). Which led to the TTY
not recognizing that someone is waiting for the input.
Fixes: #20503
Refs: #18372
PR-URL: #21690
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
targos
pushed a commit
that referenced
this pull request
Aug 11, 2018
Avoid trying to emit 'readable' due to the fact that
state.length is always >= state.highWaterMark if highWaterMark is 0.
Therefore upon .read(0) call (through .on('readable')) stream assumed
that it has enough data to emit 'readable' even though
state.length === 0 instead of issuing _read(). Which led to the TTY
not recognizing that someone is waiting for the input.
Fixes: #20503
Refs: #18372
PR-URL: #21690
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
firass111
pushed a commit
to firass111/Project_node1
that referenced
this pull request
Apr 16, 2025
Avoid trying to emit 'readable' due to the fact that
state.length is always >= state.highWaterMark if highWaterMark is 0.
Therefore upon .read(0) call (through .on('readable')) stream assumed
that it has enough data to emit 'readable' even though
state.length === 0 instead of issuing _read(). Which led to the TTY
not recognizing that someone is waiting for the input.
Fixes: nodejs/node#20503
Refs: nodejs/node#18372
PR-URL: nodejs/node#21690
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
stream
This fixes an issue introduced by #17979 where the readable event are sometimes emitted when the stream is neither readable nor has it ended.