wapc-rust icon indicating copy to clipboard operation
wapc-rust copied to clipboard

interrupt wasm module

Open srenatus opened this issue 3 years ago • 3 comments

Hi. I'm further diving into wapc, and there're some very nice ideas in there! 😃

One thing I could not find so far is, are you able to stop a guest call of it's taking too much time? In wasmtime, you'd use the interrupt handle to set a trap, but I don't see why of that used here. What's your approach? 🤔

srenatus avatar May 14 '21 08:05 srenatus

The wapc host runtime (Rust) supports multiple engines, wasm3 and wasmtime. As such we can't support things like aborting an execution unless both engines support it.

That said, wasmcloud, which builds on top of wapc, does have time limits and can abort calls, It just doesn't use the wasm engine to do it.

autodidaddict avatar May 14 '21 10:05 autodidaddict

That said, wasmcloud, which builds on top of wapc, does have time limits and can abort calls, It just doesn't use the wasm engine to do it.

Would you mind going into detail, or sharing a code link, please?

srenatus avatar May 14 '21 11:05 srenatus

Sure. If you take a look at wasmcloud in the wasmcloud host crate you'll see where we have a bunch of rpc timeouts.

That said, if a guest wasm spins into an infinite loop we do not currently have a way to shut that down gracefully, and we can use this issue to track that.

In short, the entire host will continue unbroken but that one module will be useless in that scenario and that's definitely something we need to take care of.

autodidaddict avatar May 14 '21 11:05 autodidaddict