Uh oh!
There was an error while loading. Please reload this page.
stream: ensure finish is emitted in next tick - #30733
Conversation
@Trott: Who's familiar with |
e197831 to
a9e54ccCompareTrott
commented
Nov 30, 2019
a9e54cc to
7ee659fCompareWhen using end() it was possible for 'finish' to be emitted synchronously.
7ee659f to
cdc12a6Comparenodejs-github-bot
commented
Dec 1, 2019
lpinca
commented
Dec 1, 2019
ronag
commented
Dec 7, 2019
@benjamingr can I get a nodejs/streams ping on this one? |
|
benjamingr
commented
Dec 7, 2019
@nodejs/streams also this is terrifying :D |
addaleax
commented
Dec 7, 2019
This needs another @nodejs/tsc approval (@mcollina?) but should otherwise be good to go |
@Trott: |
Trott
commented
Dec 14, 2019
CITGM looks good. |
When using end() it was possible for 'finish' to be emitted synchronously. PR-URL: #30733 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Trott
commented
Dec 14, 2019
Landed in e13a37e |
When using
end()it was possible for'finish'to be emitted synchronously causing incorrect behaviour and subtle bugs.This is an edge case not usually encountered since a
write()is usually pending and will be the one to initiatefinishMaybe()throughafterWritewhich is always async.This PR also cause
_destroy()to be called in nextTick whenautoDestroyis enabled during this edge case.NOTE:
'prefinish'must be synchronous in order to not breakTransform. I've got another PR in the works to sort this out.Should probably be semver major.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes