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

[browser][mt] Propagate unhandled JS errors in JSWebWorker to the top level Task #76957

Open
Tracked by #68162
lambdageek opened this issue Oct 12, 2022 · 5 comments
Open
Tracked by #68162
Assignees
Labels
arch-wasm WebAssembly architecture area-VM-threading-mono os-browser Browser variant of arch-wasm
Milestone

Comments

@lambdageek
Copy link
Member

lambdageek commented Oct 12, 2022

If user code uses setTimeout to queue work on the JSWebWorker and that code throws unhandled exceptions, we should not bring down the whole runtime in a disorganized manner.

Should we propagate unhandled JS errors the JSWebWorker top level Task ?

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Oct 12, 2022
@lambdageek lambdageek changed the title protect pthread workers from unhandled JS exceptions. [wasm-mt] protect pthread workers from unhandled JS exceptions. Oct 12, 2022
@lambdageek lambdageek added arch-wasm WebAssembly architecture area-VM-threading-mono and removed untriaged New issue has not been triaged by the area owner labels Oct 12, 2022
@lambdageek lambdageek added this to the 8.0.0 milestone Oct 12, 2022
@ghost
Copy link

ghost commented Oct 12, 2022

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

null

Author: lambdageek
Assignees: -
Labels:

arch-wasm, area-Threading-mono

Milestone: -

@lewing lewing modified the milestones: 8.0.0, 9.0.0 Jul 24, 2023
@pavelsavara
Copy link
Member

pavelsavara commented Nov 9, 2023

I guess we don't have any manifestation of this yet?

Anyway, I think that calling back from JS to C# will happen via JSExport and that propagates exceptions correctly.

Is there another concern ?

@pavelsavara pavelsavara added the os-browser Browser variant of arch-wasm label Nov 9, 2023
@pavelsavara pavelsavara changed the title [wasm-mt] protect pthread workers from unhandled JS exceptions. [browser][mt] protect pthread workers from unhandled JS exceptions. Nov 9, 2023
@pavelsavara
Copy link
Member

pavelsavara commented Jan 31, 2024

We do subscribe to unhandledrejection and error top level events in the UI thread and shut down the runtime when that happens, when internal withExitOnUnhandledError is used.

globalThis.addEventListener("unhandledrejection", (event) => handler(event, event.reason));
globalThis.addEventListener("error", (event) => handler(event, event.error));

Is that too strict ?
Should we adopt the same on the JSWebWorker too ?

@pavelsavara
Copy link
Member

pavelsavara commented Jan 31, 2024

Maybe JSWebWorker should propagate unhandled JS errors from setTimeout to the JSWebWorker top level Task ?

@pavelsavara pavelsavara changed the title [browser][mt] protect pthread workers from unhandled JS exceptions. [browser][mt] Propagate unhandled JS errors in JSWebWorker to the top level Task Feb 5, 2024
@pavelsavara pavelsavara modified the milestones: 9.0.0, Future Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-wasm WebAssembly architecture area-VM-threading-mono os-browser Browser variant of arch-wasm
Projects
None yet
Development

No branches or pull requests

3 participants