Cloudflare details how Rust Workers now handle panic and abort recovery in WebAssembly via upstream contributions to wasm-bindgen. Historically, panics were fatal and could poison an entire Worker instance, causing cascading failures. The team implemented panic=unwind support using the WebAssembly Exception Handling proposal, allowing panics to surface as JavaScript PanicError exceptions while keeping the Wasm instance valid. For aborts (e.g., OOM), they added abort classification using Exception.Tag to distinguish recoverable from non-recoverable errors, plus a set_on_abort hook and reentrancy guards. A --reset-state-function mechanism enables automatic reinitialization for Wasm library use cases. The team also backported modern WebAssembly Exception Handling to Node.js 24 and 22 to unblock ecosystem adoption. These changes are available in workers-rs 0.8.0 via the --panic-unwind flag, with plans to make it the default.

11m read timeFrom blog.cloudflare.com
Post cover image
Table of contents
Initial recovery mitigationsImplementing panic=unwind with WebAssembly Exception HandlingAbort recoveryExtension: abort reinitialization for wasm-bindgen librariesMaturing the Rust Wasm Exception Handling ecosystemUsing panic unwind in Rust WorkersCommitting to Rust Workers stability

Sort: