Go theorytheory 0/50 · 0%
Operations · hard

47. Graceful Shutdown and Resilience

Signals, draining and retries.

Catch SIGTERM with signal.NotifyContext, stop accepting new work, drain in-flight requests with Server.Shutdown, then close resources. Add bounded retries with exponential backoff and jitter, plus circuit breakers, so upstream failures do not cascade.

Check your understanding

  1. 1. Which method drains an http.Server?

  2. 2. Retries should include…