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

Runing slr a second time makes original cluster unmanageable #88

Open
grimborg opened this issue Feb 4, 2015 · 2 comments
Open

Runing slr a second time makes original cluster unmanageable #88

grimborg opened this issue Feb 4, 2015 · 2 comments
Assignees

Comments

@grimborg
Copy link

grimborg commented Feb 4, 2015

I've noticed that if I run slr a second time (by mistake), the original cluster becomes unmanageable.

$ slr --pid pid_file --size 4 --detach my/server.js
$ slr
--whoops, I meant slrc, ctrl-C
$ slrc
Communication error (connect ENOENT), check master is listening 

The original cluster is still running, but slrc can no longer communicate with the master.

Is this the intended behaviour? Is there a way for slr to check whether it's already running?

Thanks

@rmg
Copy link
Member

rmg commented Feb 4, 2015

The problem is that the way the process detaches makes it harder to check for these sorts of error conditions and report them in a useful way.

This is one of the problems with detach that led us to create strong-pm.

What is the purpose of using --detach in this case?

@sam-github
Copy link
Contributor

The core problem is that slrc needs a fixed address to connect to. It happens to use unix domain sockets, the runctl socket (configurable, of course, but thats the default). When you run again, the new slr grabs the socket, so now the first slr doesn't have it. I could fail out.... but unfortunately, unix domain sockets have the unfortunate characteristic that they live past process death, and you can't tell if they are alive or not. At least not easily, though I think I just thought of a way.

All of which is to say, I'm not sure what we could do differently. But I would suggest never running detached! Use multiple terminals, tmux if you can, and run the supervisor in one, the runner in the other.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants