Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP keep mill server alive if you Ctrl-C during --watch #339

Merged
merged 3 commits into from
May 19, 2018
Merged

Conversation

lihaoyi
Copy link
Member

@lihaoyi lihaoyi commented May 19, 2018

Fixes #327

This introduces a new idle flag next to done inside MillServerMain#handleRun, which is temporarily set to true during the --watch phase. interruptServer is then skipped if the MillServerActionRunner thread is idle, letting the normal t.interrupt/t.stop calls interrupt & clean it up.

This also makes the Mill server ignore SIGINT, since otherwise Ctrl-C on the Mill client will propagate through the parent-child process relationship and kill the server too.

On the side, this also cleans up the Mill Client's Java code to use try-with-resources to ensure resources get properly cleaned up, and names the various threads we spawn & main methods we use for better debuggability.

@lihaoyi lihaoyi force-pushed the keep-watch branch 3 times, most recently from 979d649 to 7b84fca Compare May 19, 2018 15:17
@lihaoyi lihaoyi merged commit a7cb99f into master May 19, 2018
@lihaoyi lihaoyi deleted the keep-watch branch November 5, 2018 14:36
@lefou lefou added this to the 0.2.1 milestone Apr 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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