You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm contributing to a project which calls async wasmtime exports. Sometimes, those exported functions start failing with the error "wasm trap: cannot enter component instance". I think the issue might be that the generated wasm client isn't cancel-safe.
Here's the relevant snippet from the generated code (generated by wit-bindgen 0.38):
The docs say that if you call TypedFunc's call_async method, you must call post_return_async. In my codebase, the code path which invokes wasm can frequently get cancelled. If this snippet is cancelled during that call to call_async. then it looks like post_return_async will never be called (and there doesn't seem to be a way to recover from that).
Am I right that this code isn't cancel-safe? And if so, is there any way to recover from the cancellation?
The text was updated successfully, but these errors were encountered:
This wit-bindgen repo is for the project that generates guest language bindings for wit. It has a common providence as the version used in wasmtime, but this question is specific to the behavior of wasmtime-wit-bindgen. Could you please reopen this ticket in the wasmtime repo?
Hello!
I'm contributing to a project which calls async wasmtime exports. Sometimes, those exported functions start failing with the error "wasm trap: cannot enter component instance". I think the issue might be that the generated wasm client isn't cancel-safe.
Here's the relevant snippet from the generated code (generated by wit-bindgen 0.38):
The docs say that if you call TypedFunc's call_async method, you must call post_return_async. In my codebase, the code path which invokes wasm can frequently get cancelled. If this snippet is cancelled during that call to
call_async
. then it looks likepost_return_async
will never be called (and there doesn't seem to be a way to recover from that).Am I right that this code isn't cancel-safe? And if so, is there any way to recover from the cancellation?
The text was updated successfully, but these errors were encountered: