arohner/lein-daemon

Placing pidfile outside of project root causes startup to hang

Opened this issue · 2 comments

If you configure your pidfile to be located anywhere outside of the project directory (for instance, /tmp/app.pid), the startup script will hang indefinitely waiting for the pidfile to appear, even though the pidfile has been created correctly.

This is happening to me too ([lein-daemon "0.5.4"]). It occurs even when the pid file is in the project root directory. When I run lein daemon run myapp, I get the following error.

java.lang.Exception: myapp failed to start in 300 seconds
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0 (NativeConstructorAccessorImpl.java:-2)
    sun.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:57)
    ...
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.main.main (main.java:37)

I've also tried putting it in the background, with lein daemon start myapp &. I think this error has to do with slow JVM startup times. It's also mentioned in this irc log. Any insights here appreciated.

Sorry for the neglect of the project. I'd recommend using https://github.com/circleci/lein-jarbin rather than lein-daemon.