Skip to content

stream: 'end' is no longer emitted after 'error' #20334

Description

@mscdex
  • Version: v10.0.0
  • Platform: n/a
  • Subsystem: stream

(I've copied this more or less from the original issue for better visibility)

With node v10 I noticed that 'end' events are no longer emitted after 'error' events for streams, which caused breakage at least with my projects and modules. I tracked it down to #20104 which was merged only 5 days ago and never landed in a v9 release. As of this writing, it's not even marked as semver-major which I think is a mistake, as it can clearly break userland.

Secondly, there is no indication in the streams documentation that this new behavior is the intended behavior.

With all of these things considered, I think the offending commit should be reverted. At the very least it should be semver-major and delayed for some time to give end users a chance to somehow deal with the change in behavior. Perhaps streams should instead emit 'close' after 'error' instead (stream implementors could opt out of this behavior via constructor options)? Something like that would allow for a much smoother transition.

Activity

  1. added
    streamIssues and PRs related to Node.js streams.
    on Apr 26, 2018
  2. targos commented on Apr 26, 2018

    @targos
    Member

    @nodejs/streams

  3. jasnell commented on Apr 26, 2018

    @jasnell
    Member

    /cc @mcollina ... In hindsight, looking it over again, this really should have been semver-major. +1 to reverting in 10.x, keeping it in 11.x, and marking it semver-major. The change itself is the correct thing to do so reverting it in master would not be the right thing.

  4. mcollina commented on Apr 26, 2018

    @mcollina
    SponsorMember

    @mscdex the PR was landed as minor because a) it didn’t break known modules and b) reacting to end after error means an hard-to-understand state.

    Did this break any module specifically?

    I’m ok to revert in 10.x.x.

  5. added a commit that references this issue on May 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    streamIssues and PRs related to Node.js streams.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions