Stream: wasmtime

Topic: Timeout Error re-entry


view this post on Zulip Ashanti Mutinta (Jun 04 2024 at 12:04):

I have this weird bug in 17.0.3, I have a set a callback that yields until it reaches a max or final value. If this value is reached it returns a trap::interrupt error. Everything seems fine but as soon as a timeout each time I create a new sandbox and invoke a function on it, it seems like it tells me "cannot enter component instance" thought I would ask if anyone has seen anything similar?

view this post on Zulip Lann Martin (Jun 04 2024 at 12:37):

After a component instance traps it is no longer usable

view this post on Zulip Ashanti Mutinta (Jun 04 2024 at 12:38):

Even if it is a new sandbox? I guess I could just change the type of error returned

view this post on Zulip Lann Martin (Jun 04 2024 at 12:40):

Could you expand on what you mean by "new sandbox"? The key type here in wasmtime would be the Instance

view this post on Zulip Ashanti Mutinta (Jun 04 2024 at 12:41):

Oh yes sorry about that. A new instance being built from a preinit-module

view this post on Zulip Lann Martin (Jun 04 2024 at 12:43):

That should be fine. The error you are seeing means that the component has been entered and not "cleanly" exited; trapping would be the most obvious reason for that in this case :shrug:

view this post on Zulip Lann Martin (Jun 04 2024 at 12:44):

Are you able to reproduce this issue on the latest wasmtime release?

view this post on Zulip Lann Martin (Jun 04 2024 at 12:44):

(I doubt this is a wasmtime bug, but if it is then upgrading would be the first step)

view this post on Zulip Ashanti Mutinta (Jun 04 2024 at 12:45):

I see, awesome. I will see if this goes away if I just use another error type. We are a bit gated to this version, but I think I will convince them to move. Need all these nice new features anyway.

view this post on Zulip Lann Martin (Jun 04 2024 at 12:50):

I have a set a callback that yields until it reaches a max or final value. If this value is reached it returns a trap::interrupt error.

Another thought: are you sure this value is being reset for each instance? If it is tracked as part of the Store<T> data (T) and the Store is reused between instances that value wouldn't automatically be reset for a new instance

view this post on Zulip Ashanti Mutinta (Jun 04 2024 at 12:53):

I think I create a store for each new instance but I should investigate if there is any reuse happening somewhere


Last updated: Dec 23 2024 at 13:07 UTC