Health Checks and Graceful Shutdown

Production services need readiness and liveness concepts. Readiness answers whether the service should receive traffic; liveness answers whether the process is alive enough for the platform to keep it running.

Graceful shutdown stops accepting new work, allows in-flight work to finish within a deadline, closes resources, and exits.

SIGTERM
  |
  v
Stop new traffic
  |
  v
Finish in-flight work
  |
  v
Close pools / clients
  |
  v
Exit
Key Takeaways
  • Readiness and liveness serve different purposes.
  • Graceful shutdown prevents dropped work during deployments.
  • Health checks should reflect meaningful service capability.