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

fix(runtime/js/workers): throw errors instead of using an op #12249

Merged
merged 4 commits into from Oct 1, 2021

Conversation

nayeemrmn
Copy link
Collaborator

@nayeemrmn nayeemrmn commented Sep 27, 2021

Fixes #11350.

@bartlomieju
Copy link
Member

I think addressing this comment is needed as well.

@nayeemrmn nayeemrmn marked this pull request as ready for review September 27, 2021 23:26
@nayeemrmn
Copy link
Collaborator Author

@andreubotella This makes workers terminate on any unhandled error, including async and message handler ones. Message handler error terminations can still be prevented with a self.onerror = () => true within the worker.

Copy link
Contributor

@andreubotella andreubotella 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 not too keen on the idea of killing the worker as soon as an error happens, especially since the error can be handled somewhere along the chain and might not end up killing the process. But I'm fine with this behavior as a stepping stone towards the behavior in #12221 (comment), since currently Deno doesn't really distinguish between sync and async errors.

I'll defer to @lucacasonato and @bartlomieju on this.

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

LGTM

I agree with @andreubotella that this is a good stepping stone but will require further iterations.

@bartlomieju bartlomieju merged commit b354eaa into denoland:main Oct 1, 2021
@nayeemrmn nayeemrmn deleted the worker-terminate-by-throwing branch October 1, 2021 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Errors in a worker's message event handler aren't reported
3 participants