pujitha24 requested wasmtime-core-reviewers for a review on PR #14904.
pujitha24 opened PR #14904 from pujitha24:auto/issue-14899 to bytecodealliance:main:
This makes
wasmtime serveshut down gracefully on SIGTERM, the same as on ctrl-c. Discussed in the issue: https://github.com/bytecodealliance/wasmtime/issues/14899Before, SIGTERM (sent by systemd and docker) killed the server immediately with exit status 143. Now it takes the graceful shutdown path and exits 0. A second signal still short-circuits waiting for remaining connections.
Validation: I ran
wasmtime serveon a small hand-written WAT component and sent SIGTERM. Before the change it exited 143; after, it exits 0. I did not add an automated test, because the wasm32 targets needed to build the test programs aren't installed on my machine. I also did not test with in-flight requests, on non-Unix platforms, or run clippy.This PR was written in part with the assistance of generative AI.
Fixes #14899
pujitha24 removed the review request for wasmtime-core-reviewers from PR #14904.
pujitha24 requested dicej for a review on PR #14904.
alexcrichton added PR #14904 serve: Gracefully shut down on SIGTERM to the merge queue.
:thumbs_up: alexcrichton submitted PR review.
github-merge-queue[bot] removed PR #14904 serve: Gracefully shut down on SIGTERM from the merge queue.
alexcrichton added PR #14904 serve: Gracefully shut down on SIGTERM to the merge queue.
:check: alexcrichton merged PR #14904.
alexcrichton removed PR #14904 serve: Gracefully shut down on SIGTERM from the merge queue.
Last updated: Oct 31 2026 at 23:03 UTC