Skip to content

Commit 1fa2ea4

Browse files
committed
Allow for workers dying in the middle of cleanup
1 parent 530805e commit 1fa2ea4

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

Diff for: src/sch/Sch.jl

+14-1
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,20 @@ function cleanup_proc(state, p, log_sink)
405405
delete!(WORKER_MONITOR_CHANS[wid], state.uid)
406406
end
407407
end
408-
remote_do(_cleanup_proc, wid, state.uid, log_sink)
408+
409+
# If the worker process is still alive, clean it up
410+
if wid in workers()
411+
try
412+
remotecall_wait(_cleanup_proc, wid, state.uid, log_sink)
413+
catch ex
414+
# We allow ProcessExitedException's, which means that the worker
415+
# shutdown halfway through cleanup.
416+
if !(ex isa ProcessExitedException)
417+
rethrow()
418+
end
419+
end
420+
end
421+
409422
timespan_finish(ctx, :cleanup_proc, (;worker=wid), nothing)
410423
end
411424

0 commit comments

Comments
 (0)