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

pm2 hangs on kill #316

Closed
kulicuu opened this issue Feb 20, 2014 · 11 comments
Closed

pm2 hangs on kill #316

kulicuu opened this issue Feb 20, 2014 · 11 comments
Labels

Comments

@kulicuu
Copy link

kulicuu commented Feb 20, 2014

Great program btw. I'm very happy to be using this.

Running on Linode from an npm script.

When I kill it / them (clustered) it just kind of hangs. I can cntrl-C to break and then pm2 list and they're dead processes. So it's not a huge issue.

@kulicuu
Copy link
Author

kulicuu commented Feb 20, 2014

Actually when I just broke from it and ran pm2 list still 2 out of the original 4 processes were still running.

If it's got open TCP connections it may have issues. If it has open clients...
If I kill all the open connections first (possible now because I'm the only user) it works, otherwise, hangcity.

@soyuka soyuka added the bug label Feb 24, 2014
@morcmarc
Copy link

I'm having the same issue, not only on kill but for restart and stop as well. If I leave it running for ~10 minutes it will stop / restart eventually. Kind of annoying. I suspect it is caused by open socket.io connections.

Edit: took the time and read the docs a bit more carefully, now I see you've already got an option to send a terminate message to the app and gracefully stop all services. Sorry.

@artworkad
Copy link

Same problem for me.

@kulicuu
Copy link
Author

kulicuu commented Apr 5, 2014

I don't know about this too much anymore. Recently I've been using the command pm2 stop all and then pm2 delete all. Not sure too much about the difference.
Really sorry I'm not more knowledgable about this but my priorities recently have been in other areas of my app than this. I got it working and now am focusing client side.
... having said that, I think it has something to do with there being open TCP connections from your clients, which you really have no control over.
... what I've done in the past is to issue the kill command and then if it's hanging to control-C to break out and then do a pm2 list to see what's going on. Usually one of the processes is at least trying to stop. Then I try the command again, and if it hangs again control-C again etc. Typically this has worked. Nothing graceful about it but it almost always worked.
Recently I haven't had much of an issue with this, though I don't know why. When I've been running pm2 stop all it's stopping everything immediately and returning a good list.

@artworkad
Copy link

Hm I don't think open connections should matter, and I don't know if they matter, like you said @kulicuu you cannot really now if there are open connections. I am on linux and this bug came from nowhere. What I do

pkill -f pm2

kill all pm2 processes and restart them. However this is ugly if you have multiple projects to restart. The owners should def have a look at this problem. @Unitech

@soyuka
Copy link
Collaborator

soyuka commented Apr 6, 2014

node version @ALL ?

@kulicuu
Copy link
Author

kulicuu commented Apr 6, 2014

good point: I'm currently running 11.9 on that one, from 10.26 before. And I might have switched up because of this issue, at least in part. Not sure if it made a difference-- as mentioned my attentions have been elsewhere.

@artworkad
Copy link

@soyuka I am on 0.10.26, debian7

@soyuka
Copy link
Collaborator

soyuka commented Apr 7, 2014

@artworkad could you try the v0.11.10 ? For a quick update try this
@kulicuu what's the memory amount of your script ? I'm facing a similar issue with 10.26, it should be related to the node version as the cluster module is a "nightmare" in the 10.26 but should be fixed with 11.x.

@kulicuu
Copy link
Author

kulicuu commented Apr 7, 2014

Memory amount:. Do you mean how much memory is it consuming ? :: (fork mode 4 processes): 124MB, 80MB, 81MB, 81MB.
It may be moot as this past week I had to switch this week away from the cluster mode and am now using fork mode because my app requires sticky sessions to support Websockets/ EngineIO sessions.
I'm going to be attempting switch back to cluster mode after implementing npm StickySession, but won't have time for that project for another few weeks maybe more.

@Unitech
Copy link
Owner

Unitech commented May 3, 2014

Fixed since 0.8.x

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

5 participants