-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
[v12.x backport] stream: destroy wrapped streams on error #35557
Conversation
Review requested:
|
cc: @ronag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
The test fails, I guess this depends on something else. |
Adapted to v12.x |
The problem was that the same |
You could change the test to allow it being emitted twice. |
I found a better fix. |
Stream should be destroyed and update state accordingly when the wrapped stream emits error. Does some additional cleanup with future TODOs that might be worth looking into. PR-URL: nodejs#34102 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
55949b6
to
4afe946
Compare
Prevent multiple listeners for the `'error'` event to be added to the same `EventEmitter` instance. PR-URL: nodejs#35560 Refs: nodejs#35557 (comment) Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Prevent multiple listeners for the `'error'` event to be added to the same `EventEmitter` instance. PR-URL: #35560 Refs: #35557 (comment) Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Stream should be destroyed and update state accordingly when the wrapped stream emits error. Does some additional cleanup with future TODOs that might be worth looking into. Backport-PR-URL: #35557 PR-URL: #34102 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
landed in e40b78c |
Stream should be destroyed and update state accordingly when the wrapped stream emits error. Does some additional cleanup with future TODOs that might be worth looking into. Backport-PR-URL: #35557 PR-URL: #34102 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Prevent multiple listeners for the `'error'` event to be added to the same `EventEmitter` instance. PR-URL: nodejs#35560 Refs: nodejs#35557 (comment) Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Stream should be destroyed and update state accordingly when
the wrapped stream emits error.
Does some additional cleanup with future TODOs that might be worth
looking into.
PR-URL: #34102
Reviewed-By: Matteo Collina matteo.collina@gmail.com
Reviewed-By: Luigi Pinca luigipinca@gmail.com
Reviewed-By: Anna Henningsen anna@addaleax.net
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes