Uh oh!
There was an error while loading. Please reload this page.
stream: don't emit drain if ended - #29086
Conversation
Trott
commented
Aug 13, 2019
@nodejs/streams |
nodejs-github-bot
commented
Aug 13, 2019
Trott
commented
Aug 16, 2019
Looks fine to me, but it would be good to have someone on @nodejs/streams vet it. Doesn't seem to have semver implications to me but there may be something subtle I'm missing? Doesn't seem like it would require benchmarking, but again, maybe I'm wrong? |
mcollina
commented
Aug 17, 2019
I’m good with this being a patch. |
Trott
commented
Aug 17, 2019
Do you still want a CITGM run? (I'm happy to do it if we want to be extra cautious, but also happy to skip it if it's not necessary.) |
Trott
left a comment
There was a problem hiding this comment.
Making my previous tentative LGTM more official.
mcollina
commented
Aug 17, 2019
via email
Having a CITGM run would be better, yes
Il giorno sab 17 ago 2019 alle 08:43 Rich Trott <notifications@github.com>
ha scritto: … ***@***.**** approved this pull request.
Making my previous tentative LGTM more official.
—
You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub
<#29086?email_source=notifications&email_token=AAAMXY4HD7EQDW626LU4VFDQE6MXNA5CNFSM4IK4BWZKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCB3OAZQ#pullrequestreview-276226150>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAMXYZOR53HD7F4GTCUBMTQE6MXNANCNFSM4IK4BWZA>
.
|
Trott
commented
Aug 17, 2019
CITGM (queued): https://ci.nodejs.org/job/citgm-smoker/1958/ |
Trott
commented
Aug 17, 2019
Those CITGM results seem OK to me after a quick review. You too @mcollina? |
Trott
commented
Aug 19, 2019
Extra-super-cautious second CITGM: https://ci.nodejs.org/job/citgm-smoker/1969/ |
Trott
commented
Aug 20, 2019
Landed in 605d7c4 |
PR-URL: #29086 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
I was mistaken. bdf07f4 is the problem, not this commit. Original comment hidden in details.This commit is causing problems. I think it should be reverted. While the docs for As a result, Thanks for your attention. |
This comment has been minimized.
This comment has been minimized.
mcollina
commented
Aug 22, 2019
Thanks, we’ll revert this asap. |
mcollina
commented
Aug 22, 2019
@isaacs have you got a module that broke/had issue about this? I'd love to add a unit test or something to CITGM so we can avoid regressions. |
Makes sense. Is there anything I can do here to follow up? Update the docs to reflect the actual behaviour? Though I still think the behaviour of this PR is the correct one. Currently it is theoretically possible to cause an write after end in otherwise valid code. I guess we could work around that by updating the docs and also asking the user to check the |
isaacs
commented
Aug 22, 2019
@mcollina Run I don't have an example of it backup up a stream and causing problems that way. It'd be harder to reproduce in the wild, because it'd depend on some very specific behavior and timing, but could probably be synthetically created in a test. |
Isn't that the same issue as #29239? i.e. something else? |
isaacs
commented
Aug 22, 2019
@ronag It could be! The issue I saw is that I'm not sure the best way to go about getting this done, but personally, I'd really like a more massive overhaul of the streams implementation if we're talking about semver major changes. The We could improve performance and vastly simplify the codebase, with a minimal disruption to userland code, by moving to something like minipass. If streams were synchronous, and the class hierarchy rooted on a passthrough implementation (rather than squishing together Readable and Writable into Duplex), then the entire system would be much less brittle. I'm not sure the best way to go about proposing that these days, but I'd be happy to help however I can. |
ronag
commented
Aug 22, 2019
isaacs
commented
Aug 22, 2019
@ronag Will do. I do still think this behavior change is a mistake in a minor version, so probably both need to be rolled back. |
PR-URL: #29086 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Don't emit
'drain'if the stream has been ended.'drain'should only be emitted if the stream wants more data.See, https://nodejs.org/api/stream.html#stream_event_drain.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesNOTE TO SELF: After this is merged look into emitting
'drain'afterstate.length < hwminstead ofstate.length === 0.