alexcrichton opened PR #14388 from alexcrichton:refactor-serve-shutdown to bytecodealliance:main:
This commit fixes an issue with the synchronization used in shutting down
wasmtime servewith a ctrl-c or a--shutdown-addroption. Notably the previously used method.notify_waiters()did not work if the acceptor loops weren't actually blocked in waiting. Using tokio'sNotifyabstraction is a bit finnicky, so this encapsulates the shutdown state in a localmodto avoid reaching into private internals outside of this small region of code, and operations are now all under theMutexfor the shutdown entirely which should provide the synchronization necessary.<!--
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 review the Bytecode Alliance's AI tool usage policy at
https://github.com/bytecodealliance/governance/blob/main/AI_TOOL_POLICY.mdPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
alexcrichton requested dicej for a review on PR #14388.
alexcrichton requested wasmtime-core-reviewers for a review on PR #14388.
:thumbs_up: dicej submitted PR review.
:speech_balloon: dicej created PR review comment:
/// Flags this state as done spawning tasks and returns a future which /// will resolve when all active tasks have completed, if any.
alexcrichton updated PR #14388.
alexcrichton has enabled auto merge for PR #14388.
alexcrichton added PR #14388 Refactor graceful shutdown in wasmtime serve to the merge queue
:check: alexcrichton merged PR #14388.
alexcrichton removed PR #14388 Refactor graceful shutdown in wasmtime serve from the merge queue
Last updated: Oct 11 2026 at 04:10 UTC