Bound each shutdown stage by the stop deadline (closes #100)
check / check (push) Canceled after 0s

Shutdown passes its context to every stage: the streamer, the four
handlers, the WHOIS fetcher, the database maintainer and the HTTP server
each stop waiting when it ends. A handler then skips its last write and
logs how many updates it did not write, and the HTTP server closes the
connections still open. The database is checkpointed and closed last,
and left open once the deadline has passed, since a write may still
hold it. The stop hook gives Shutdown 8 seconds and fx 9, inside the 10
seconds upaas and docker stop allow, so a stop signal exits 0.

Model: opus-5-5
This commit is contained in:
2026-10-19 23:13:03 +00:00
parent 76c2e523b5
commit 276a3c81ad
16 changed files with 657 additions and 126 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ func main() {
if err != nil {
log.Fatal("Failed to start streamer:", err)
}
defer s.Stop()
defer s.Stop(context.Background())
// Set up context with cancellation
ctx, cancel := context.WithCancel(context.Background())