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

A robust shutdown routine wraps cleanup in a timeout that force-exits if cleanup hangs. What subtle bug does this timer introduce, and how is it fixed?

function shutdown() { const t = setTimeout(() => process.exit(1), 10000); cleanup().then(() => process.exit(0)); }