You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
server: main exits before graceful shutdown (drain, WAL checkpoint, dbClose) completes #577
Found in the #571 review (Minimax). This is pre-existing and was not changed by #571.
cmd/server/main.go: main returns as soon as ListenAndServe returns ErrServerClosed. That happens at the start of httpServer.Shutdown, and main does not wait for the shutdown goroutine. As a result, the client drain, the WAL checkpoint and dbClose race process exit. The deferred stopPingScoreHistory happens to buy time.
Fix:main waits on a done channel from the shutdown goroutine, with a bounded timeout. Add a process test asserting that "shutdown complete" is logged and that the DB is closed cleanly on SIGTERM.
Activity
dborup commentedon Oct 25, 2026
Fixed by #582 (merged as
fe3b650c3c25abb2cccfb471495158b84cab90de).