Add graceful shutdown to the HTTP server #1
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
server::servecurrently callsaxum::serve(listener, app).awaitwith no shutdown signal, so it runs forever and is killed abruptly (crates/server/src/lib.rs).Before the service is deployed for real (self-host is a first-class target, see
docs/specs/2026-06-02-mvp-architecture.md§12), wirewith_graceful_shutdowntoSIGTERM/SIGINTso in-flight requests can drain and the DB pool closes cleanly.axum::serve(...).with_graceful_shutdown(...).sqlxpool on shutdown.Source: Foundation (Plan 0) final review — deferred, non-blocking.