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: pipeline uncaught error #28818

Closed
wants to merge 1 commit into from

Conversation

ronag
Copy link
Member

@ronag ronag commented Jul 23, 2019

There are stream(like)s both in node and ecosystem that can emit an error after finished/eos. This will cause the process to unexpectedly exit with an uncaught error exception.

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

@ronag ronag force-pushed the stream-pipeline-uncaught branch 2 times, most recently from dcc86f8 to 9136ca1 Compare July 23, 2019 08:56
@Fishrock123 Fishrock123 added the stream Issues and PRs related to the stream subsystem. label Jul 24, 2019
@Fishrock123
Copy link
Contributor

That sounds like an implementation problem in a userland stream. I don't know that we should cover that at risk of obscuring valid problems?

@ronag
Copy link
Member Author

ronag commented Jul 24, 2019

We have it in native streams as well...

@ronag
Copy link
Member Author

ronag commented Jul 24, 2019

The rule (as far as I understand) is that streams can emit errors all the way until ‘close’. ‘eos’ finishes before ‘close’.

@ronag
Copy link
Member Author

ronag commented Jul 24, 2019

There is actually already a bug in eos where it doesn’t remove its error listener. So this PR doesn’t actually change any behavior until eos is fixed.

@Trott
Copy link
Member

Trott commented Jul 25, 2019

@ronag Should this remain open? If so, is it blocked by something else?

@ronag
Copy link
Member Author

ronag commented Jul 26, 2019

It should remain open and is not blocked

@Trott
Copy link
Member

Trott commented Jul 26, 2019

/ping @nodejs/streams

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.

This needs a unit test

@mafintosh
Copy link
Member

That eos does not remove the error listener is not a bug but a feature to handle exactly this problem

@ronag
Copy link
Member Author

ronag commented Jul 26, 2019

That eos does not remove the error listener is not a bug but a feature to handle exactly this problem

That seems a little random? Shouldn't "the problem" be handled as local as possible? Currently, using finished could unexpectedly swallow errors?

@lpinca @mcollina

@ronag ronag mentioned this pull request Jul 26, 2019
4 tasks
@ronag ronag force-pushed the stream-pipeline-uncaught branch 3 times, most recently from e85141d to 31b89c3 Compare July 26, 2019 10:13
@ronag
Copy link
Member Author

ronag commented Aug 2, 2019

@mcollina a unit test here won't really help since eos (incorrectly?) leaves a dangling 'error' handler. Until that is fixed this change is pretty much a noop. How should we/I handle that?

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.

I’m -1. This is handled by eos already, in fact this change has to disable it.

I don’t understand why this is worth considering.

@ronag
Copy link
Member Author

ronag commented Aug 2, 2019

@mcollina Updated with unit test.

This is handled by eos already, in fact this change has to disable it.

It is "magical" and also undocumented that eos handles it. I'm also of the opinion that eos should not leave dangling listeners once it has completed, i.e. currently (outside of pipeline use) it can unexpectedly swallow errors. However, that can not be "fixed"/changed until something like this PR.

If this PR is rejected I would at least suggest we update the documentation for eos/finished.

@mcollina
Copy link
Member

mcollina commented Aug 2, 2019

I think the correct approach is to document it in eos.

@ronag
Copy link
Member Author

ronag commented Aug 2, 2019

Sure, @lpinca do you have any opinion or should I just close this?

@ronag
Copy link
Member Author

ronag commented Aug 2, 2019

@mcollina I guess you are -1 on this as well then #28820?

@ronag ronag closed this Aug 2, 2019
@mcollina
Copy link
Member

mcollina commented Aug 2, 2019

Yes, exactly.

@ronag
Copy link
Member Author

ronag commented Aug 2, 2019

New PR with documentation change: #28935

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