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: ensure errorEmitted is always set #28709

Closed

Conversation

ronag
Copy link
Member

@ronag ronag commented Jul 15, 2019

_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-bot nodejs-github-bot added the stream Issues and PRs related to the stream subsystem. label Jul 15, 2019
@ronag
Copy link
Member Author

ronag commented Jul 15, 2019

@mcollina ping (sorry for spam?)

@ronag ronag force-pushed the stream-always-set-error-emitted branch from 44e5572 to 51428f8 Compare July 15, 2019 22:05
@ronag ronag force-pushed the stream-always-set-error-emitted branch from 51428f8 to d7bc957 Compare July 15, 2019 22:27
@ronag ronag mentioned this pull request Jul 15, 2019
@mcollina
Copy link
Member

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

@ronag
Copy link
Member Author

ronag commented Jul 16, 2019

@mcollina: Not sure what you expect there :/

@mcollina
Copy link
Member

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

@ronag
Copy link
Member Author

ronag commented Jul 16, 2019

@mcollina
Copy link
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
Copy link
Member Author

ronag commented Jul 16, 2019

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
Contributor

mscdex commented Jul 16, 2019

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

@ronag ronag force-pushed the stream-always-set-error-emitted branch from d7bc957 to 821cc7a Compare July 16, 2019 17:05
@ronag
Copy link
Member Author

ronag commented Jul 16, 2019

@mcollina tests updated

@ronag ronag force-pushed the stream-always-set-error-emitted branch 3 times, most recently from 432d8b2 to a2b670a Compare July 16, 2019 18:09
@nodejs-github-bot
Copy link
Collaborator

lib/_stream_writable.js Show resolved Hide resolved
@ronag ronag force-pushed the stream-always-set-error-emitted branch 6 times, most recently from 1c99240 to f018384 Compare August 2, 2019 07:59
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

LGTM

@ronag ronag mentioned this pull request Aug 6, 2019
7 tasks
@mcollina
Copy link
Member

mcollina commented Aug 7, 2019

1 similar comment
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@mcollina
Copy link
Member

mcollina commented Aug 8, 2019

@mcollina
Copy link
Member

mcollina commented Aug 9, 2019

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

@ronag ronag force-pushed the stream-always-set-error-emitted branch from f018384 to 51d97bf Compare August 9, 2019 11:41
@ronag
Copy link
Member Author

ronag commented Aug 9, 2019

Rebased.

@nodejs-github-bot
Copy link
Collaborator

@mcollina
Copy link
Member

mcollina commented Aug 9, 2019

@ronag
Copy link
Member Author

ronag commented Aug 19, 2019

This was fixed in 4a2bd69

@ronag ronag closed this Aug 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stream Issues and PRs related to the stream subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants