◐ Shell
clean mode source ↗

stream: don't flush destroyed writable by ronag · Pull Request #29028 · nodejs/node

Closed

ronag

wants to merge 4 commits into

Hidden character warning

The head ref may contain hidden characters:

"stream-flush-destro\u00fded-writable"

Conversation

@ronag

It doesn't make much sense (and is a bit weird) to flush a stream which has been destroyed.

I need help creating a relevant test for this.

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

NOTE TO SELF: Look into needFinish & stream destroyed. errorOrDestroy added in this PR should preferably be async.

@ronag ronag mentioned this pull request

Aug 6, 2019

4 tasks

mscdex

jasnell

@jasnell

Hmm.. I'm thinking this is more bug fix than breaking change. What do you think @mcollina?

mcollina

Choose a reason for hiding this comment

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

This will need a unit test.

I'm happy to land this as a bug fix as long as it does not break anything on CITGM.

@mafintosh

@nodejs-github-bot

@ronag

ronag

mcollina

Choose a reason for hiding this comment

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

I would still consider this a bugfix, but we should:

  1. verify that CITGM passes
  2. let it bake for LTS (10.x) for some time before backporting.

@nodejs-github-bot

@mcollina

@ronag

@mcollina: Sorry, found further issues.

Consider the updated tests. We now will throw ERR_STREAM_DESTROYED on some tests that assume ERR_STREAM_WRITE_AFTER_END also we now send the err on the write callback and don't emit it as an error on the stream.

How should this be?

addaleax

Choose a reason for hiding this comment

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

I wouldn’t mind being careful and labelling this semver-major.

@ronag

Ok, I think everything (expect @mcollina's comment on !err && chinksWritten++) is fixed in a sensical manner.

@ronag ronag mentioned this pull request

Aug 8, 2019

This was referenced

Jan 20, 2021

This was referenced

Sep 5, 2021

Reviewers

@Trott Trott Trott left review comments

@mcollina mcollina mcollina approved these changes

@jasnell jasnell jasnell approved these changes

@addaleax addaleax addaleax approved these changes

@mafintosh mafintosh Awaiting requested review from mafintosh

+1 more reviewer

@mscdex mscdex mscdex left review comments

Reviewers whose approvals may not affect merge requirements

Labels

semver-major

PRs that contain breaking changes and should be released in the next major version.

stream

Issues and PRs related to the stream subsystem.