Comparison
Graceful shutdownvsTermination grace period
Graceful shutdown
on SIGTERM you stop accepting new requests, finish the ones in flight, and only then exit.
Ending a process in a way that does not drop work: deregister from the load balancer, stop accepting, complete in-flight requests, close connections, exit. Without it, every deploy sheds a burst of errors proportional to your request rate. The grace period must exceed your longest normal request, or the platform kills you mid-request anyway.
Full entry →Termination grace period
you get thirty seconds after the signal to finish, and at second thirty-one you are killed with no negotiation.
The window between the polite termination signal and the unconditional kill. It has to exceed the longest piece of work a container can legitimately be doing, which for a request handler is short and for a batch consumer can be minutes. Every deployment being exactly as slow as this number is the classic sign that nothing is handling the signal and everything is waiting to be killed.
Full entry →