GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||
GeezerVison is showing github.com — stream: fix readable behavior for highWaterMark === 0 by lundibundi · Pull Request #21690 · nodejs/node Conversation
|
|
/cc @nodejs/streams |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
ab7ddcd to
d14752c
Compare
|
ping @mcollina. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
d14752c to
4df321c
Compare
There was an error while loading. Please reload this page.
|
Well, CI has failed due to my test... I'm not sure how to handle tty stdin on CI, as it works fine locally. It seems to close the stdin even before the setTimeout fires, can someone help? Should I |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
When reading the description of the test it seems like these should be .on instead of once?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Typo in the.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
If you want to actually test a tty you have to move the test in the corresponding tty test folder. Otherwise it's not detected as try.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@BridgeAR thanks a lot, I've missed that. Should be fixed now. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Should this not also just be on?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks, idk why did I think it was okay to put once on both of them. 🤔
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
code LGTM. Can land if citgm does not report additional breakage.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Seems good, but CITGM is currently not very healthy: nodejs/build#1429. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I'm not I understand why this is needed for TTYs to work? Can someone clarify this for me? The unneeded readables was breaking of code for me, and as I understand this, it restores that behaivor? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@mafintosh After your comment, I went to double check and found a better way of tackling this problem. But I also discovered the other thing. Your PR is indeed fixing the issue of empty-readable but the thing is, it suppresses the issue by not emitting the event but there are still multiple calls to The thing is that with the write pattern as in there are 2 more 'emit readable rStream' that were suppressed and I think at least the second one shouldn't have happened at all (the first one is from the latest data push). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
ce3551e to
e874f79
Compare
|
@mcollina @mafintosh @BridgeAR I'd like another review as I changed this PR's idea. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Can you add some tests that shows the changed behavior in streams? I'd like to see a a test that failed in current master but passes here.
I think we would need to add some docs for highWaterMark: 0. There aren't any atm.
(Using the big red cross because I approved it in the past)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
We'll need to adjust this comment.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
this comment will need an update.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
It's not really clear what it is changing here. Can you describe it the change to streams a bit more? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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
e874f79 to
e5a6527
Compare
There was an error while loading. Please reload this page.
|
@mcollina cleaned up the PR (and removed redundant checks) and added relevant test without the TTY. Yeah, this shouldn't change anything, it's a bug fix, bad wording, sorry. I've updated the description. P.s. Streams sure are tough, thanks for bearing with me. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Thanks for taking these issue, they are indeed! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Very nice fix in the end |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Landed in fe47b8b |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @lundibundi for tackling this one! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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 <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
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 <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
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 <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.