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

Bloop should explain how to start itself when it cannot connect to the server #209

Closed
Duhemm opened this issue Jan 29, 2018 · 4 comments
Closed

Comments

@Duhemm
Copy link
Collaborator

Duhemm commented Jan 29, 2018

Currently, running bloop when there's no server started prints:

Could not connect to server 127.0.0.1:8212

It would be better to add something along the lines of:

Have you forgotten to start the server? It can be started with blp-server

Moreover, if we're changing the name of the server executable, that will make it harder to discover, and more users risk hitting that.

This should be improved in the python script.

@propensive
Copy link
Contributor

propensive commented Jan 29, 2018

I have wrapped bloop in a script which checks whether the server is running, and if not, starts it in a screen session, something like,

(netstat -ln | grep -q `:8212 ' || (screen -X -S bloop quit ; screen -S bloop -d -m ~/.bloop/blp-server && sleep 1)) && bloop "$@"

There's a lot of ugly stuff in there, and it relies on screen and netstat and (worst of all) sleep, but it has meant I haven't had to think much about starter the server when it's not running.

Might be useful as the basis for something less hacky...

@olafurpg
Copy link
Contributor

olafurpg commented Jan 29, 2018

On OSX, I've found launch agents to work really well. I set it up once in December and the server has always been up when I've run bloop since then. To restart the server I run launchctl stop Bloop.

@jvican
Copy link
Contributor

jvican commented Feb 19, 2018

For now, I lean towards not focusing on this issue and letting users deal with it manually. In the future, it would be nice if bloop starts the server on its own, but this is not something we should focus on in the long term.

The very notion of a client-server should be ingrained in people's mind when they use bloop, and I find this kind of user error to be beneficial in the long-term: it prevents users from running two servers.

Related ticket upstream: facebookarchive/nailgun#55.

jvican added a commit to scalacenter/nailgun that referenced this issue Mar 6, 2018
jvican added a commit that referenced this issue Mar 6, 2018
jvican added a commit that referenced this issue Mar 6, 2018
Co-authored-by: Duhemm <[email protected]>
Co-authored-by: Jorge Vicente Cantero <[email protected]>
@jvican
Copy link
Contributor

jvican commented Mar 6, 2018

Fixed in #293.

@jvican jvican closed this as completed Mar 6, 2018
jvican added a commit to scalacenter/nailgun that referenced this issue Apr 5, 2018
jvican added a commit to scalacenter/nailgun that referenced this issue Apr 5, 2018
jvican added a commit to scalacenter/nailgun that referenced this issue May 7, 2018
jvican added a commit to scalacenter/nailgun that referenced this issue Jul 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants