#5645·pm2

Getting Requests after SIGINT causing Non Zero Downtime Reload

Author: Abhay2012Created Jul 25, 2023Updated Aug 5, 2026

Issue: I'm running PM2 in cluster mode with 2 instances. On reloading the application I wanted to check if the existing instance is processing a request then wait for it to get complete and then call process.exit().

I'm using SIGINT event in express to check if all the requests got processed then call process.exit. But even after receiving SIGINT event. the old process is still getting requests, resulting SIGKILL and closing client connections forcefully.

Expected Behaviour: Once a process gets SIGINT, PM2 should forward new traffic to the other process, and once 1st process got reloaded properly then do a similar for the 2nd one.

I'm using getConnections in SIGINT event to check currently active requests:

javascript
server.getConnections(function (err, count) {
    if (count == 0) process.exit(0);
    else console.log("Can't shutdown! Pending requests...");		
});

Is there any other way to handle this, some of the requests are getting socket hang-up on reload, Which means it's not Zero downtime reload?