com-lihaoyi/mill

Avoid killing mill daemon if Ctrl-C interrupt occurs during file-watching mode

lihaoyi opened this issue · 0 comments

Currently, we kill the Mill daemon every time you Ctrl-C on the Mill client, as we do not want a useless background daemon running forever unnecessarily and we also cannot trust the JVM not to fall into a bad state using Thread.stop to interrupt the computation (in Ammonite the JVM does fall into a bad state sometimes, but since it's an interactive repl it's much easier to notice/remedy than if the Mill background daemon did the same).

However, once Mill has completed running it's task and is in --watch/-w mode, Ctrl-C should allow the Mill client to exit without killing the Mill server, since the watch loop should be trivially stop-able. That would avoid paying the cost of spinning up a new JVM every time you exit --watch