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

stream: prevent 'end' to be emitted after 'error' #20571

Closed
wants to merge 1 commit into from

Conversation

mcollina
Copy link
Member

@mcollina mcollina commented May 7, 2018

This PR adds _readableState.errorEmitted and add the tracking of it.

Fixes: #6083
See: #20334
See: #20449

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

This reverts commit 8f6ab9f.

This PR adds _readableState.errorEmitted and add the tracking of it.

Fixes: nodejs#6083
See: nodejs#20334
See: nodejs#20449
@mcollina mcollina added the semver-major PRs that contain breaking changes and should be released in the next major version. label May 7, 2018
@nodejs-github-bot nodejs-github-bot added the stream Issues and PRs related to the stream subsystem. label May 7, 2018
@mcollina
Copy link
Member Author

mcollina commented May 7, 2018

cc @nodejs/streams @mscdex @addaleax @lpinca resubmitted the PR as semver-major. Let me know.

@mscdex
Copy link
Contributor

mscdex commented May 7, 2018

I still believe we should not just remove this outright but instead replace it with another event. One possible event I previously suggested was 'close', with stream implementors being able to opt-out if they need to manually emit 'close' (e.g. fs.ReadStream/fs.WriteStream). This one would work well because 'close' has already been working this way in core, as it gets emitted whether there was an 'error' event or not. However, I am not really opposed to using a different event name if need be.

Copy link
Contributor

@mscdex mscdex left a comment

Choose a reason for hiding this comment

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

-1 on this as-is

@mcollina
Copy link
Member Author

mcollina commented May 7, 2018

@mscdex would you be ok if this was part of #20096? I think it goes in the same direction.

@mscdex
Copy link
Contributor

mscdex commented May 7, 2018

@mcollina I'm not sure what you mean. The issue you linked to more or less seems to include what I was pretty much saying, however there does not seem to be any PR associated with the issue.

@jasnell
Copy link
Member

jasnell commented May 23, 2018

Ping @mcollina @mscdex ... would like to see resolution on this. What's the next step?

@mcollina
Copy link
Member Author

mcollina commented May 23, 2018

This will be included in #20096, which @mafintosh and myself are going to talk about at the summit. Also, everybody is welcomed to participate.

@BridgeAR BridgeAR added the wip Issues and PRs that are still a work in progress. label May 29, 2018
@jasnell
Copy link
Member

jasnell commented Oct 17, 2018

@mcollina ... what's the status on this?

@jasnell jasnell added the stalled Issues and PRs that are stalled. label Oct 17, 2018
@mcollina
Copy link
Member Author

This can be closed for the moment, it will be fixed with the destroy work @mafintosh has been preparing for some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-major PRs that contain breaking changes and should be released in the next major version. stalled Issues and PRs that are stalled. stream Issues and PRs related to the stream subsystem. wip Issues and PRs that are still a work in progress.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants