workers-rs icon indicating copy to clipboard operation
workers-rs copied to clipboard

Consider extending panic recovery to all Wasm critical errors

Open guybedford opened this issue 3 months ago • 1 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

Description

The new panic recovery system recovers only on explicit Rust pancis.

There are other errors that would not trigger this recovery:

  • Stack size exceeded
  • Memory access out of bounds
  • could not allocate memory
  • unreachable

It could be possible to also catch these cases and similarly issue a Wasm VM reset internally, by wrapping all top-level invocations with these error handlers.

This would be a bit more invasive than the panic handler work though, so should only be investigated if we are seeing other errors of this type transitioning Wasm into an invalid state.

guybedford avatar Sep 24 '25 16:09 guybedford

Supporting out of memory would be the highest priority here to start at least.

guybedford avatar Oct 20 '25 04:10 guybedford