@@ -113,7 +113,7 @@ addprocs([
113113
114114* `exeflags`: additional flags passed to the worker processes. It can either be a `Cmd`, a `String`
115115 holding one flag, or a collection of strings, with one element per flag.
116- E.g. `\` --threads=auto project=.\` `, `"--compile-trace=stderr"` or `["--threads=auto", "--compile=all"]`.
116+ E.g. `\` --threads=auto project=.\` `, `"--compile-trace=stderr"` or `["--threads=auto", "--compile=all"]`.
117117
118118* `topology`: Specifies how the workers connect to each other. Sending a message between
119119 unconnected workers results in an error.
@@ -740,16 +740,25 @@ function kill(manager::SSHManager, pid::Int, config::WorkerConfig)
740740 nothing
741741end
742742
743- function kill (manager:: LocalManager , pid:: Int , config:: WorkerConfig ; exit_timeout = 15 , term_timeout = 15 )
743+ function kill (manager:: LocalManager , pid:: Int , config:: WorkerConfig ; profile_wait = 6 , exit_timeout = 15 , term_timeout = 15 )
744+ # profile_wait = 6 is 1s for profile, 5s for the report to show
744745 # First, try sending `exit()` to the remote over the usual control channels
745746 remote_do (exit, pid)
746747
748+ profile_sig = Sys. iswindows () ? nothing : Sys. isbsd () ? (" SIGINFO" , 29 ) : (" SIGUSR1" , 10 )
749+
747750 timer_task = @async begin
748751 sleep (exit_timeout)
749752
750753 # Check to see if our child exited, and if not, send an actual kill signal
751754 if ! process_exited (config. process)
752- @warn (" Failed to gracefully kill worker $(pid) , sending SIGQUIT" )
755+ @warn " Failed to gracefully kill worker $(pid) "
756+ if profile_sig != = nothing
757+ @info (" Sending profile $(profile_sig[1 ]) to worker $(pid) " )
758+ kill (config. process, profile_sig[2 ])
759+ sleep (profile_wait)
760+ end
761+ @warn (" Sending SIGQUIT to worker $(pid) " )
753762 kill (config. process, Base. SIGQUIT)
754763
755764 sleep (term_timeout)
0 commit comments