On SIGTERM, flip readiness to fail first so the load balancer drains, keep liveness green while in-flight Express/Nest requests finish, then close the server and exit before the stop timeout. Mixing DB checks into the liveness probe is what turns a short dependency blip into a restart storm — keep liveness process-only and put dependency depth on readiness (or a separate monitor path) that never drives restarts.
Ops prove-out: docker stop (or an orchestrator rolling replace) a single replica under light traffic, watch readiness go 503 before connections drop, confirm no 5xx spike on the balancer, and measure that the process exits inside the stop grace window. If requests die immediately or the container is killed hard, readiness was not failing early enough or the shutdown handler never closed the listener.
Node Edge Ops