Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumNodeJSgraceful shutdown handlingSingle-choice MCQ

What is the danger in this SIGTERM handler when a deployment sends repeated signals or shutdown stalls?

let shuttingDown = false; process.on('SIGTERM', async () => { await drainQueue(); await server.close(); process.exit(0); });