leiningen icon indicating copy to clipboard operation
leiningen copied to clipboard

Exiting leiningen with Ctrl-C leaves an orphaned java process on cygwin/windows

Open jtcbrule opened this issue 10 years ago • 3 comments

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.

jtcbrule avatar Jul 30 '14 18:07 jtcbrule

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.

mpdehaan avatar May 20 '15 18:05 mpdehaan

This may be related to #1854.

hypirion avatar Nov 03 '15 23:11 hypirion

@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 ?

ysl208 avatar Sep 30 '20 06:09 ysl208