Graceful shutdown
End a process cleanly: stop accepting new requests, wait for in-flight ones, release locks, flush buffers, close connections. Opposite: hard kill (SIGKILL) which terminates immediately.
Unix signals: SIGTERM (polite request, default in kill) → process cleans up → SIGKILL after timeout. Kubernetes pod lifecycle: terminationGracePeriodSeconds (default 30s), preStop hook for custom cleanup. Classic pitfalls: ignoring SIGTERM (hangs), leaking connections (db pool, redis), in-flight requests becoming 502. Best practice: drain the load balancer first, then end the process. Connection draining + retries are the pair that gives zero-downtime deploys.