[BUG] host shutdown with a Ctrl-C exits with a warning
Affected project(s)
- [ ] documentation
- [ ] examples
- [X] wasmCloud host
- [ ] wasmCloud CLI (wash)
- [ ] wasmCloud dashboard UI (washboard)
- [ ] capability providers
- [ ] provider bindgen
- [ ] control interface client
- [ ] other / not sure
Describe the bug
Stopping the host with Ctrl-C successfully kills the host, but it ends with a warning that the wasmtime epoch interrupt thread is timing out:
Error: failed to shutdown host
Caused by:
epoch interrupt thread timed out
Steps to reproduce
- Start a wasmcloud host, wadm, nats
- Start a wadm manifest (I've been using the rust http hello app)
- Ctrl-C in a terminal to stop the host
- Observe the error
Expected behavior
I expected the host to stop without that warning.
If it's a bug in the way we're stopping wasmtime the we should fix it, otherwise we should downgrade the warning if there is nothing for us to do.
Environment
- OS: OSX
- Shell zsh
- wasmcloud Version: v1.3.0
Screenshots / Logs / Additional context
No response
It's actually a duplicate of https://github.com/wasmCloud/wasmCloud/issues/2391, which was closed a few months ago. Not sure if it's a regression though, I think this is simply a race condition in shutdown sequence, which was never fixed.
I also encounter this one quite often
Yep I think this isn't a regression as much as it just wasn't truly resolved 😅
Digging in, this is almost certainly due to any running component taking a reference to the underlying Runtime Engine and the epoch thread not exiting until every reference is dropped.