leiningen
leiningen copied to clipboard
Exiting leiningen with Ctrl-C leaves an orphaned java process on cygwin/windows
With Leiningen 2.4.2 (Java 1.8.0_05 64-bit), from a cygwin shell, executing "$ lein repl" spawns a new bash process, a bash subprocess, and two java subprocesses.
bash.exe (original)
bash.exe (new)
- bash.exe
- - java.exe
- - - java.exe
(The last java subprocess is only spawned when invoking "$ lein repl" from inside a project directory; "$ lein repl" from, say, my home directory only creates the single java subprocess.)
(exit) or Ctrl-D kills the entire tower of subprocess, but Ctrl-C leaves the last java process orphaned.
This usually isn't an issue, since I normally quit with Ctrl-D or (exit), but if I'm forced to quit with Ctrl-C (e.g. infinite loop, or certain lein plugins like gorilla), then I have to manually track down and kill the Java process.
I'm actually seeing similar behavior to this on 2.5.1 lein on Ubuntu 14.04, default shell, etc. Can't figure out why. True even after exiting the repl with "exit" and getting the usual "bye" message.
This may be related to #1854.
@mpdehaan I'm experiencing the same behaviour on Ubuntu 20.04 and 18.04, Leiningen 2.9.1 on Java 11.0.8. Any workaround ?