Skip to content

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

Closed
@mscdex

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    streamIssues and PRs related to the stream subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions