fix(process-cleanup): call process.exit() after SIGTERM cleanup
scheduleForcedExit was called without exitAfterCleanup=true for SIGTERM/SIGINT. After cleanup completed, timeout cleared but process.exit() never called. Process stayed alive waiting for event loop to drain. Benchmark (systemctl stop): - Before: 10s+ timeout (systemd had to SIGKILL) - After: ~30ms instant shutdown Test results (3 runs): - Test 1: 30ms - Test 2: 28ms - Test 3: 27ms
This commit is contained in:
@@ -40,7 +40,7 @@ function registerProcessSignal(
|
||||
const listener = () => {
|
||||
const cleanupResult = handler()
|
||||
if (exitAfter) {
|
||||
scheduleForcedExit(cleanupResult, 0)
|
||||
scheduleForcedExit(cleanupResult, 0, true)
|
||||
}
|
||||
}
|
||||
process.on(signal, listener)
|
||||
|
||||
Reference in New Issue
Block a user