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

Handle WebAssembly.RuntimeError by closing communication channel #467

Merged
merged 2 commits into from
Aug 5, 2024

Conversation

georgestagg
Copy link
Member

@georgestagg georgestagg commented Aug 5, 2024

This PR makes two changes:

  1. If WebAssembly.RuntimeError is raised and bubbles all the way up to the top level, catch it and report the problem as unrecoverable on console.error(). Then close the communication channel, terminating the worker thread.

  2. If a communication channel has been closed, reject any promises trying to write on the channel with a WebRChannelError.

Closes #464, because the OOM error is a WebAssembly.RuntimeError.

Base automatically changed from startup-worker-error to main August 5, 2024 12:23
@georgestagg georgestagg merged commit 7451e60 into main Aug 5, 2024
4 checks passed
@georgestagg georgestagg deleted the oom-error branch August 5, 2024 12:56
@jeroen
Copy link
Contributor

jeroen commented Aug 5, 2024

Thanks! Going to test this in r-universe right away.

@georgestagg
Copy link
Member Author

georgestagg commented Aug 5, 2024

Hopefully the OOM failure behaviour is more reasonable now!

BTW you might need to wait a little while for CI to catch up, it rebuilds absolutely everything from scratch and takes a while before uploading the new Wasm binaries to AWS.

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.

WebR OOM handing
2 participants