jargon

Comparison

Graceful shutdownvsPID 1 problem

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 →

PID 1 problem

the shutdown signal is delivered and ignored, and every rollout takes exactly thirty seconds per pod before something kills it.

The consequence of a container's first process being PID 1: the kernel applies no default signal handlers to it, and it is responsible for reaping orphaned children. An application never written to be an init system therefore ignores SIGTERM and leaks zombie processes. The fixes are to handle signals properly in the application, use the runtime's small init helper, or exec the real process so it becomes PID 1 itself.

Full entry →

Related comparisons