feat: implement graceful shutdown on SIGTERM/SIGINT with in-flight request draining #201
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?
Context
The server runs as a Kubernetes pod with Recreate strategy. When Flux updates the deployment, the pod receives SIGTERM. Without graceful shutdown, in-flight requests are dropped abruptly.
Tasks
Acceptance Criteria
Reference
Roadmap Phase 3.3 — Deployment details (Recreate strategy, single replica)
Triage: Assigned to @developer. Implement graceful shutdown in
cmd/server/main.go: listen for SIGTERM/SIGINT, callhttp.Server.Shutdown()with a timeout context to drain in-flight requests. Currently useshttp.ListenAndServewhich does not handle graceful shutdown. No dependencies. Priority: P2.