Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a multi-threaded Tokio runtime as a fallback
This commit fixes a bug that was introduced in bytecodealliance#8190 and brought up on [Zulip]. In bytecodealliance#8190 there was a subtle change in how Tokio and the CLI are managed, namely that a Tokio runtime is installed at the start of the CLI to avoid entering/exiting the runtime on each blocking call. This had a small performance improvement relative to entering/exiting on each blocking call. This meant, though, that calls previously blocked with `Runtime::block_on` and now block with `Handle::block_on`. The [documentation of `Handle::block_on`][doc] has a clause that says that for single-threaded runtimes I/O and timers won't work. To fix this issue I've switch the fallback runtime to a multi-threaded runtime to ensure that I/O and timers continue to work. [Zulip]: https://bytecodealliance.zulipchat.com/#narrow/stream/219900-wasi/topic/Wasi-http.20requests.20hang/near/429187256 [doc]: https://docs.rs/tokio/latest/tokio/runtime/struct.Handle.html#method.block_on
- Loading branch information