Skip to content
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

[v8.x backport] stream: ensure writable.destroy() emits error once #28000

Closed
wants to merge 1 commit into from

Conversation

lpinca
Copy link
Member

@lpinca lpinca commented Jun 1, 2019

Prevent the 'error' event from being emitted multiple times if
writable.destroy() is called with an error before the _destroy()
callback is called.

Emit the first error, discard all others.

PR-URL: #26057
Fixes: #26015
Reviewed-By: Matteo Collina matteo.collina@gmail.com
Reviewed-By: Ruben Bridgewater ruben@bridgewater.de
Reviewed-By: James M Snell jasnell@gmail.com

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Prevent the `'error'` event from being emitted multiple times if
`writable.destroy()` is called with an error before the `_destroy()`
callback is called.

Emit the first error, discard all others.

PR-URL: nodejs#26057
Backport-PR-URL: nodejs#28000
Fixes: nodejs#26015
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
@lpinca
Copy link
Member Author

lpinca commented Jun 1, 2019

@nodejs/streams @nodejs/lts

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot
Copy link
Collaborator

@addaleax addaleax added stream Issues and PRs related to the stream subsystem. v8.x labels Jun 2, 2019
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sam-github sam-github closed this Jun 5, 2019
@lpinca
Copy link
Member Author

lpinca commented Jun 5, 2019

@sam-github I think this did not land, was it closed on purpose?

@lpinca lpinca reopened this Jun 5, 2019
@Trott
Copy link
Member

Trott commented Jul 5, 2019

@nodejs/releasers Anything keeping this one open at this point? Should it land?

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

BethGriggs pushed a commit that referenced this pull request Sep 19, 2019
Prevent the `'error'` event from being emitted multiple times if
`writable.destroy()` is called with an error before the `_destroy()`
callback is called.

Emit the first error, discard all others.

PR-URL: #26057
Backport-PR-URL: #28000
Fixes: #26015
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
@BethGriggs
Copy link
Member

Landed on v8.x-staging

@BethGriggs BethGriggs closed this Sep 19, 2019
@lpinca lpinca deleted the backport/26057-to-v8.x branch September 19, 2019 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stream Issues and PRs related to the stream subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants