Skip to content

Commit 75559cb

Browse files
JamesWrigleyjpsamaroo
authored andcommitted
Only cleanup worker processes if they still exist
Previously this was attempting to cleanup processes that had already died, which caused exceptions. Wait for the processor to be cleaned up in cleanup_proc()
1 parent 20d0695 commit 75559cb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/sch/Sch.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,12 @@ function cleanup_proc(state, p, log_sink)
406406
delete!(WORKER_MONITOR_CHANS[wid], state.uid)
407407
end
408408
end
409-
remote_do(_cleanup_proc, wid, state.uid, log_sink)
409+
410+
# If the worker process is still alive, clean it up
411+
if wid in workers()
412+
remotecall_wait(_cleanup_proc, wid, state.uid, log_sink)
413+
end
414+
410415
timespan_finish(ctx, :cleanup_proc, (;worker=wid), nothing)
411416
end
412417

0 commit comments

Comments
 (0)