Docker and CI/CD · Middle · Question 7 of 75
What should a Node.js server do on SIGTERM?
- ✓Correct answer: Stop accepting connections, finish requests, close pools, then exit
- 2Ignore it, since the orchestrator will send SIGKILL anyway
- 3Exit immediately with code 0 so the container stops quickly
Explanation
server.close() stops new connections while in-flight requests complete. Then close database pools and exit within the grace period.