interruption with CTRL-C
Hi, I use DaemonMode to run my unit tests. If I interrupt the execution with CTRL-C, the client aborts but the server sometimes continues running the tests. Is there any way to abort them?
I tried this, but I'm not even able to get into the "catch" to detect when the daemon execution should be aborted
Base.exit_on_sigint(false)
try
runargs()
catch e
println(\"crashed\")
end
thanks
I faced this also in https://github.com/c42f/RemoteREPL.jl/issues/16, and implemented a partial solution there for remote processes in https://github.com/c42f/RemoteREPL.jl/pull/24
However, in general having CTRL-C handling as capable as the normal Julia REPL is a hard problem which (a) requires an entirely separate supervisor process and (b) if implemented with SIGINT, could kill a Task which is unrelated to the tests you're trying to run. (For example, if you're running two separate sets of tests within the same daemonmode process.)
For DeamonMode.jl a full solution would be possible with a supervisor and persistent worker processes. (As an in-process async server, RemoteREPL can't easily take this same approach.)
On Windows, running julia with --handle-signals=no makes the daemon stoppable with ^C (I think the shell just simply terminate the process). Otherwise julia will hang when terminated with ^C.