GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — stream: ensure writable.destroy() emits error once by lpinca · Pull Request #26057 · nodejs/node

Conversation

@lpinca

@lpinca lpinca commented Feb 12, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

Fixes: #26015
Refs: #20745 (comment)

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@lpinca
stream: ensure writable.destroy() emits error once
bfb0cef
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.

Fixes: nodejs#26015
@nodejs-github-bot

nodejs-github-bot commented Feb 12, 2019

Copy link
Copy Markdown
Collaborator

@lpinca build started: https://ci.nodejs.org/blue/organizations/jenkins/node-test-pull-request-lite-pipeline/detail/node-test-pull-request-lite-pipeline/2578/pipeline

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lpinca

lpinca commented Feb 12, 2019

Copy link
Copy Markdown
Member Author

This does not fix the issue for readable only streams.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax addaleax added the stream Issues and PRs related to Node.js streams. label Feb 13, 2019
@addaleax

addaleax commented Feb 13, 2019

Copy link
Copy Markdown
Member

@nodejs/streams

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ZYSzys
ZYSzys reviewed Feb 14, 2019
View reviewed changes
Comment thread lib/internal/streams/destroy.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@lpinca

lpinca commented Mar 2, 2019

Copy link
Copy Markdown
Member Author

cc: @nodejs/streams
CI: https://ci.nodejs.org/job/node-test-pull-request/21114/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mcollina
mcollina approved these changes Mar 2, 2019
View reviewed changes

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
BridgeAR
BridgeAR approved these changes Mar 5, 2019
View reviewed changes
@BridgeAR BridgeAR added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Mar 5, 2019
@BridgeAR

BridgeAR commented Mar 5, 2019

Copy link
Copy Markdown
Member

Should we actually allow calling destroy() more than once in the first place?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mcollina

mcollina commented Mar 5, 2019

Copy link
Copy Markdown
Member

Should we actually allow calling destroy() more than once in the first place?

Yes. This is actually an use case of the API (historically).

BridgeAR reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jasnell
jasnell approved these changes Mar 5, 2019
View reviewed changes
@BridgeAR

BridgeAR commented Mar 5, 2019

Copy link
Copy Markdown
Member

Landed in 49f1bb9 🎉

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@BridgeAR BridgeAR closed this Mar 5, 2019
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request Mar 5, 2019
@lpinca @BridgeAR
stream: ensure writable.destroy() emits error once
49f1bb9
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
Fixes: nodejs#26015
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@lpinca
lpinca deleted the gh-26015 branch March 6, 2019 06:37
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request Mar 12, 2019
@lpinca @BridgeAR
stream: ensure writable.destroy() emits error once
82a68ce
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
Fixes: nodejs#26015
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@BridgeAR BridgeAR mentioned this pull request Mar 13, 2019
2019-03-14, Version 11.12.0 (Current) #26644
Merged
BethGriggs pushed a commit that referenced this pull request Apr 16, 2019
@lpinca @BethGriggs
stream: ensure writable.destroy() emits error once
99c555a
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 <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@BethGriggs BethGriggs mentioned this pull request May 1, 2019
v10.16.0 proposal #27514
Merged
This was referenced May 29, 2019
2019-05-28 Version 10.16.0 'Dubnium' (LTS) @BethGriggs beevelop/docker-android-nodejs#315
Closed
2019-05-28 Version 10.16.0 'Dubnium' (LTS) @BethGriggs beevelop/docker-android-nodejs#316
Closed
2019-05-28 Version 10.16.0 'Dubnium' (LTS) @BethGriggs beevelop/docker-android-nodejs#317
Closed
2019-05-28 Version 10.16.0 'Dubnium' (LTS) @BethGriggs beevelop/docker-android-nodejs#318
Closed
2019-05-28 Version 10.16.0 'Dubnium' (LTS) @BethGriggs beevelop/docker-android-nodejs#319
Closed
@lpinca lpinca mentioned this pull request Jun 1, 2019
[v8.x backport] stream: ensure writable.destroy() emits error once #28000
Closed
3 tasks done
lpinca added a commit to lpinca/node that referenced this pull request Jun 1, 2019
@lpinca
stream: ensure writable.destroy() emits error once
fa109c1
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 <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: James M Snell <[email protected]>
BethGriggs pushed a commit that referenced this pull request Sep 19, 2019
@lpinca @BethGriggs
stream: ensure writable.destroy() emits error once
3ee076f
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 <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@BethGriggs BethGriggs mentioned this pull request Sep 19, 2019
v8.16.2 proposal #29617
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ZYSzys ZYSzys ZYSzys left review comments
@mcollina mcollina mcollina approved these changes
@jasnell jasnell jasnell approved these changes
@BridgeAR BridgeAR BridgeAR approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. stream Issues and PRs related to Node.js streams.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

The 'error' event can be emitted more than once when using writable.destroy()

Uh oh!

There was an error while loading. Please reload this page.

7 participants

@lpinca @nodejs-github-bot @addaleax @BridgeAR @mcollina @jasnell @ZYSzys
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.