These are chat archives for ensime/ensime-atom

3rd
Jul 2015
Arnout Engelen
@raboof
Jul 03 2015 08:27
Hmm, 0.16.0 doesn't seem to start the ensime server for me (I just see a 'ECONNREFUSED' in the developer tools but that makes sense as ensime isn't running at all)
Viktor Hedefalk
@hedefalk
Jul 03 2015 11:46
@fommil can you try to see if you can find any stack trace in dev tools? Also see if it helps to clear classpath files and port file. It doesnt start server if a port file is already present. I haven't had issues since server seems very good at deleting it.
Sorry. @raboof.
Arnout Engelen
@raboof
Jul 03 2015 11:50
ahh it was a stale port file indeed
Viktor Hedefalk
@hedefalk
Jul 03 2015 13:27
Ok, yeah, I guess this isn't optimal… Thing is I wanted to have a long running server at some point even if I restarted Atom itself. There's a setting for it, to run the server process detached. And so Atom just checks if there's already a port file and in that case doesn't start any server. I think I once had the same problem you have now, but ensime server seems very good at cleaning up.
Don't know if there's a smart way… Don't think doing ps and stuff from Atom is good idea…
Arnout Engelen
@raboof
Jul 03 2015 13:48
agreed, but something like 'try to connect to the port in the port file, if that fails start ensime anyway and retry (once)' might make sense
Rory Graves
@rorygraves
Jul 03 2015 13:56

I was thinking about going one step further - if port file is missing - start server otherwise:
1) Try to connect to that port
2) On failure start a server with an option to make it use the port listed in the port file
3) On server start failure - report error

I think this needs a tweak on the server side, but means that if the file is there but unbound (i.e. no server running it will reuse that port), if it cannot bind that port it means something else really is running and we should report an error

(Been thinking about the same problem in the sublime plugin)
Viktor Hedefalk
@hedefalk
Jul 03 2015 14:05
All good ideas!
Rory Graves
@rorygraves
Jul 03 2015 14:17
@hedefalk FYI - In terms of long running servers - there is a open pr ensime/ensime-server#1028 which fixes some disconnect/reconnect issues - I've been using it for sublime testing