NestJS · Senior · Question 27 of 75
How should a Nest app shut down in Kubernetes to avoid dropped requests?
- 1Ignore
SIGTERMand wait forSIGKILL - ✓Correct answer: On
SIGTERM, fail readiness, keep serving in-flight requests, then close the server and connections in shutdown hooks within the grace period - 3Exit immediately on
SIGTERM
Explanation
Enable shutdown hooks; also set keep-alive timeouts correctly behind load balancers.