Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process mysteriously restarted after removal #613

Closed
rvangundy opened this issue Aug 4, 2014 · 4 comments
Closed

Process mysteriously restarted after removal #613

rvangundy opened this issue Aug 4, 2014 · 4 comments
Assignees
Labels

Comments

@rvangundy
Copy link

Very strange behavior here. I start a process, then stop it and delete it. I no longer see the process in pm2 list. If I try starting the process again, I see errors indicating ports are already used (similar to #350 ). I check for processes on those ports using the netstat command and manually kill them. At this point, if I check pm2 list again, the process is back on the list.

A few times I've been able to stop and delete the process, then just wait a while, check pm2 list again and see that the process is back on the list.

PM2 version: 0.9.5
NodeJS version: v0.10.30
OS Version: Ubuntu 14.04

Here's the file I use when starting PM2:

 {
  "apps" : [
  {
    "name"   : "web",
    "script" : "/usr/bin/node-debug",
    "args": "['index.js', '--debug-brk=false']",
    "exec_mode" : "fork_mode",
    "exec_interpreter": "none",
    "ignoreWatch" : ["client"],
    "watch"       : "./",
    "env" : {
        "NODE_ENV":"development",
        "PORT": 8000
    }
  },
  {
    "name" : "SASS",
    "script" : "/home/vagrant/.gem/ruby/2.1.0/bin/sass",
    "args": "['--watch', 'client/styles/sass/main.scss:client/styles/main.css']",
    "exec_mode" : "fork_mode",
    "exec_interpreter": "none"
  }
  ]
}
@YvonneZhang
Copy link

I have the same problem today, with issue like #494. Even running the kill <pid> command, the process still exists and, as you said, is back on the pm2 list.

I think the issue might be related to the option --watch + pm2 restart, and this seems to be a known bug in issue #494. My solution is: running pm2 kill, maybe not good enough, but the zombie processes finally be removed.

@soyuka
Copy link
Collaborator

soyuka commented Aug 5, 2014

We might want to check that watchers are destroyed when the kill command's been running (+ delete).

@soyuka soyuka self-assigned this Aug 5, 2014
soyuka pushed a commit to soyuka/pm2 that referenced this issue Aug 7, 2014
On kill deleteAll watchers
Improved tests
@soyuka soyuka added bug labels Aug 7, 2014
@soyuka
Copy link
Collaborator

soyuka commented Aug 7, 2014

I think this is definitly related to #494.

I wasn't able to reproduce this on purpose but I had some ghost processes once.
I thought this might be because the watcher is restarting the process when it's currently restarting. In the case of a server, port'll be in use but pm2 won't see it so it'd be showed as errored.

I made some attempt to fix it but I really need a way to reproduce the issue!

If you have any clue on how to make this happend, please share (:.

@rvangundy
Copy link
Author

I'm running this inside a vagrant virtualbox that's using rsync to keep files synchronized between host and guest, if that helps. I'll dig in and try to determine something more repeatable.

@soyuka soyuka closed this as completed in 090c032 Aug 8, 2014
Unitech added a commit that referenced this issue Aug 8, 2014
Unitech added a commit that referenced this issue Aug 8, 2014
Unitech added a commit that referenced this issue Aug 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants