Skip to content

stream: ensure errorEmitted is always set - #28709

Closed
ronag wants to merge 1 commit into
nodejs:masterfrom
nxtedition:stream-always-set-error-emitted
Closed

stream: ensure errorEmitted is always set#28709
ronag wants to merge 1 commit into
nodejs:masterfrom
nxtedition:stream-always-set-error-emitted

Conversation

@ronag

Copy link
Copy Markdown
Member

_writableState.errorEmitted should always be set on error.

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

@nodejs-github-botnodejs-github-bot added the stream Issues and PRs related to the stream subsystem. label Jul 15, 2019
@ronag

Copy link
Copy Markdown
MemberAuthor

@mcollina ping (sorry for spam?)

@ronag
ronagforce-pushed the stream-always-set-error-emitted branch from 44e5572 to 51428f8CompareJuly 15, 2019 22:05
Comment threadlib/internal/streams/destroy.js Outdated
@ronag
ronagforce-pushed the stream-always-set-error-emitted branch from 51428f8 to d7bc957CompareJuly 15, 2019 22:27
@ronagronag mentioned this pull request Jul 15, 2019
@mcollina

Copy link
Copy Markdown
Member

Would you mind adding another unit test on the actual behavior change? What consequences has setting errorEmitted in there?

@ronag

Copy link
Copy Markdown
MemberAuthor

@mcollina: Not sure what you expect there :/

@mcollina

Copy link
Copy Markdown
Member

I don't know why you are proposing this change. What's the end user result for this?

@ronag

Copy link
Copy Markdown
MemberAuthor

@mcollina

Copy link
Copy Markdown
Member

+1.

I prefer tests that try to double-emit errors and we block them rather than tests about internals. That's what I'm asking for.

Why would you not do this change to ensure errorEmitted is (almost) always what you assume it to be?

I'm conservative of changes, as every change we do to streams can break a lot of people.

@ronag

ronag commented Jul 16, 2019

Copy link
Copy Markdown
MemberAuthor

I prefer tests that try to double-emit errors and we block them rather than tests about internals. That's what I'm asking for.

Thank you. Makes sense.

I'm conservative of changes, as every change we do to streams can break a lot of people.

Haha, I guess that is your job.

I'm very keen on consistency and predicability. Unfortunately at the moment it is almost a requirement to read the Node code to figure out how things actually work before using them. I will try to help out within your zone.

@mscdex

Copy link
Copy Markdown
Contributor

I agree, we should be running CITGM for the event and stream-related changes in this and the other PRs.

@ronag
ronagforce-pushed the stream-always-set-error-emitted branch from d7bc957 to 821cc7aCompareJuly 16, 2019 17:05
@ronag

Copy link
Copy Markdown
MemberAuthor

@mcollina tests updated

@ronag
ronagforce-pushed the stream-always-set-error-emitted branch 3 times, most recently from 432d8b2 to a2b670aCompareJuly 16, 2019 18:09
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Comment threadlib/_stream_writable.js Outdated
@ronag
ronagforce-pushed the stream-always-set-error-emitted branch 6 times, most recently from 1c99240 to f018384CompareAugust 2, 2019 07:59

@mcollinamcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@ronagronag mentioned this pull request Aug 6, 2019
7 tasks
@mcollina

Copy link
Copy Markdown
Member

1 similar comment
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@mcollina

Copy link
Copy Markdown
Member

@mcollina

Copy link
Copy Markdown
Member

Can you rebase on top of master? CITGM is failing because of that esm bug.

@ronag
ronagforce-pushed the stream-always-set-error-emitted branch from f018384 to 51d97bfCompareAugust 9, 2019 11:41
@ronag

ronag commented Aug 9, 2019

Copy link
Copy Markdown
MemberAuthor

Rebased.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@mcollina

Copy link
Copy Markdown
Member

@ronag

Copy link
Copy Markdown
MemberAuthor

This was fixed in 4a2bd69

@ronagronag closed this Aug 19, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

streamIssues and PRs related to the stream subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@ronag@mcollina@mscdex@nodejs-github-bot@jasnell