Commit 79679db 1 parent e868f00 commit 79679db Copy full SHA for 79679db
File tree 1 file changed +7
-0
lines changed
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -331,6 +331,12 @@ Daemon.prototype.sendReady = function(cb) {
331
331
Daemon . prototype . gracefullExit = function ( ) {
332
332
var that = this ;
333
333
334
+ // never execute multiple gracefullExit simultaneously
335
+ // this can lead to loss of some apps in dump file
336
+ if ( this . isExiting ) return
337
+
338
+ this . isExiting = true
339
+
334
340
God . bus . emit ( 'pm2:kill' , {
335
341
status : 'killed' ,
336
342
msg : 'pm2 has been killed by SIGNAL'
@@ -352,6 +358,7 @@ Daemon.prototype.gracefullExit = function() {
352
358
fs . unlinkSync ( that . pid_path ) ;
353
359
} catch ( e ) { }
354
360
setTimeout ( function ( ) {
361
+ that . isExiting = false
355
362
console . log ( 'Exited peacefully' ) ;
356
363
process . exit ( cst . SUCCESS_EXIT ) ;
357
364
} , 2 ) ;
You can’t perform that action at this time.
0 commit comments