Skip to content

Commit e018d9c

Browse files
committed
Replace a sleep() call with timedwait() when killing workers
This prevents a lingering task during precompilation.
1 parent d548dee commit e018d9c

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/managers.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -761,11 +761,10 @@ function kill(manager::LocalManager, pid::Int, config::WorkerConfig; profile_wai
761761
remote_do(exit, pid)
762762

763763
timer_task = @async begin
764-
sleep(exit_timeout)
764+
process = config.process::Process
765765

766766
# Check to see if our child exited, and if not, send an actual kill signal
767-
process = config.process::Process
768-
if !process_exited(process)
767+
if timedwait(() -> process_exited(process), exit_timeout) === :timed_out
769768
@warn "Failed to gracefully kill worker $(pid)"
770769
profile_sig = Sys.iswindows() ? nothing : Sys.isbsd() ? ("SIGINFO", 29) : ("SIGUSR1" , 10)
771770
if profile_sig !== nothing

0 commit comments

Comments
 (0)