{"action":"created","issue":{"url":"https://api.github.com/repos/Unitech/pm2/issues/1702","repository_url":"https://api.github.com/repos/Unitech/pm2","labels_url":"https://api.github.com/repos/Unitech/pm2/issues/1702/labels{/name}","comments_url":"https://api.github.com/repos/Unitech/pm2/issues/1702/comments","events_url":"https://api.github.com/repos/Unitech/pm2/issues/1702/events","html_url":"https://github.com/Unitech/pm2/issues/1702","id":112242337,"number":1702,"title":"Error on gracefulReload when app handling long requests?","user":{"login":"mattcasey","id":305398,"avatar_url":"https://avatars.githubusercontent.com/u/305398?v=3","gravatar_id":"","url":"https://api.github.com/users/mattcasey","html_url":"https://github.com/mattcasey","followers_url":"https://api.github.com/users/mattcasey/followers","following_url":"https://api.github.com/users/mattcasey/following{/other_user}","gists_url":"https://api.github.com/users/mattcasey/gists{/gist_id}","starred_url":"https://api.github.com/users/mattcasey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattcasey/subscriptions","organizations_url":"https://api.github.com/users/mattcasey/orgs","repos_url":"https://api.github.com/users/mattcasey/repos","events_url":"https://api.github.com/users/mattcasey/events{/privacy}","received_events_url":"https://api.github.com/users/mattcasey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-19T22:01:42Z","updated_at":"2016-03-07T16:10:38Z","closed_at":null,"body":"We have the same process deployed on two separate machines, node v0.12.7 and pm2 0.14.7 on a 4-core machine in AWS.\r\n\r\nWe've recently started using 'startOrGracefulReload' to restart these apps, they are both serving as an internal api. The 1st one eventually restarts in under 2 minutes but it is used for fast queries in production. The 2nd one handles much longer queries, however, such that it really can't be graceful. When pm2 hits this limit everything seems to go to hell, and it tries to update itself (?!). When I first discovered the process was down, I noticed that my processes were all gone and each replaced with a 'pm2 update' command.\r\n\r\nIn the following example, you can see the logs where i initially started the process, but then it was triggered to restart and couldn't:\r\n```\r\ninternal_api-0 2015-10-19T20:33:54.884Z - info: Express server listening on port 3002 in production mode\r\ninternal_api-0 info: Mongoose connection open\r\ninternal_api-1 2015-10-19T20:33:54.994Z - info: Express server listening on port 3002 in production mode\r\ninternal_api-1 info: Mongoose connection open\r\ninternal_api-2 2015-10-19T20:33:55.069Z - info: Express server listening on port 3002 in production mode\r\ninternal_api-2 info: Mongoose connection open\r\ninternal_api-3 2015-10-19T20:33:55.155Z - info: Express server listening on port 3002 in production mode\r\ninternal_api-3 info: Mongoose connection open\r\ninternal_api-0 Deprecation warning: moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779\r\ninternal_api-2 Deprecation warning: moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779\r\nPM2 Starting execution sequence in -cluster mode- for app name:internal_api id:0\r\nPM2 App name:internal_api id:0 online\r\ninternal_api-0 info: Overriding Mongo uri: mongodb://ip-10-0-0-162.ec2.internal:27017\r\ninternal_api-0 info: Overriding Mongo options: slaveOk=true, readPreference=secondary, w=0\r\ninternal_api-0 2015-10-19T20:52:58.489Z - info: Express server listening on port 3002 in production mode\r\ninternal_api-0 info: Mongoose connection open\r\nPM2 Stopping app:internal_api id:_old_0\r\nPM2 Process with pid 6761 still not killed, retrying...\r\nPM2 Process with pid 6761 still not killed, retrying...\r\nPM2 Process with pid 6761 still not killed, retrying...\r\nPM2 Process with pid 6761 still not killed, retrying...\r\nPM2 Process with pid 6761 still not killed, retrying...\r\nPM2 Process with pid 6761 still not killed, retrying...\r\nPM2 Process with pid 6761 still not killed, retrying...\r\nPM2 Process with pid 6761 still not killed, retrying...\r\nPM2 Process with pid 6761 still not killed, retrying...\r\nPM2 Process with pid 6761 still not killed, retrying...\r\nPM2 Process with pid 6761 still not killed, retrying...\r\nPM2 Process with pid 6761 still not killed, retrying...\r\nPM2 Process with pid 6761 still not killed, retrying...\r\nPM2 Process with pid 6761 still not killed, retrying...\r\nPM2 Process with pid 6761 still not killed, retrying...\r\nPM2 Process with pid 6761 still alive after 1600ms, sending it SIGKILL now...\r\nPM2 [PM2] Error caught by domain:\r\nError: kill ESRCH\r\n    at exports._errnoException (util.js:746:11)\r\n    at process.kill (node.js:627:15)\r\n    at null._onTimeout (/home/ubuntu/npm/lib/node_modules/pm2/lib/God/Methods.js:216:17)\r\n    at Timer.listOnTimeout (timers.js:119:15)\r\nPM2 [PM2] Trying to update PM2...\r\nPM2 Stopping app:internal_api id:0\r\nPM2 App name:internal_api id:0 disconnected\r\nPM2 App name:internal_api id:0 exited with code 7\r\nPM2 [HandleExit] PM2 is being killed, stopping restart procedure...\r\nPM2 Process with pid 7078 killed\r\nPM2 Stopping app:internal_api id:1\r\nPM2 App name:internal_api id:1 disconnected\r\nPM2 App name:internal_api id:1 exited with code 7\r\nPM2 [HandleExit] PM2 is being killed, stopping restart procedure...\r\nPM2 Process with pid 6770 killed\r\nPM2 Stopping app:internal_api id:2\r\nPM2 App name:internal_api id:2 disconnected\r\nPM2 App name:internal_api id:2 exited with code 7\r\nPM2 [HandleExit] PM2 is being killed, stopping restart procedure...\r\nPM2 Process with pid 6779 killed\r\nPM2 Stopping app:internal_api id:3\r\nPM2 Process with pid 6788 still not killed, retrying...\r\nPM2 Process with pid 6788 still not killed, retrying...\r\nPM2 Process with pid 6788 still not killed, retrying...\r\nPM2 Process with pid 6788 still not killed, retrying...\r\nPM2 Process with pid 6788 still not killed, retrying...\r\nPM2 Process with pid 6788 still not killed, retrying...\r\nPM2 Process with pid 6788 still not killed, retrying...\r\nPM2 Process with pid 6788 still not killed, retrying...\r\nPM2 Process with pid 6788 still not killed, retrying...\r\nPM2 Process with pid 6788 still not killed, retrying...\r\nPM2 Process with pid 6788 still not killed, retrying...\r\nPM2 Process with pid 6788 still not killed, retrying...\r\nPM2 Process with pid 6788 still not killed, retrying...\r\nPM2 Process with pid 6788 still not killed, retrying...\r\nPM2 Process with pid 6788 still not killed, retrying...\r\n```"},"comment":{"url":"https://api.github.com/repos/Unitech/pm2/issues/comments/193319414","html_url":"https://github.com/Unitech/pm2/issues/1702#issuecomment-193319414","issue_url":"https://api.github.com/repos/Unitech/pm2/issues/1702","id":193319414,"user":{"login":"hankchiutw","id":9998118,"avatar_url":"https://avatars.githubusercontent.com/u/9998118?v=3","gravatar_id":"","url":"https://api.github.com/users/hankchiutw","html_url":"https://github.com/hankchiutw","followers_url":"https://api.github.com/users/hankchiutw/followers","following_url":"https://api.github.com/users/hankchiutw/following{/other_user}","gists_url":"https://api.github.com/users/hankchiutw/gists{/gist_id}","starred_url":"https://api.github.com/users/hankchiutw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hankchiutw/subscriptions","organizations_url":"https://api.github.com/users/hankchiutw/orgs","repos_url":"https://api.github.com/users/hankchiutw/repos","events_url":"https://api.github.com/users/hankchiutw/events{/privacy}","received_events_url":"https://api.github.com/users/hankchiutw/received_events","type":"User","site_admin":false},"created_at":"2016-03-07T16:10:38Z","updated_at":"2016-03-07T16:10:38Z","body":"Seems related to #1974 "}}