alexcrichton opened PR #8229 from alexcrichton:fix-blocking-io-and-timers
to bytecodealliance:main
:
This commit fixes a bug that was introduced in #8190 and brought up on [Zulip]. In #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 withHandle::block_on
. The [documentation ofHandle::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<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
alexcrichton requested fitzgen for a review on PR #8229.
alexcrichton requested wasmtime-core-reviewers for a review on PR #8229.
peterhuene submitted PR review.
alexcrichton merged PR #8229.
Last updated: Dec 23 2024 at 12:05 UTC