Skip to content

Commit 4d123ac

Browse files
committed
Allow for dead workers in safepoint()
1 parent 1fa2ea4 commit 4d123ac

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/sch/dynamic.jl

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,18 @@ function safepoint(state)
3333
if state.halt.set
3434
# Force dynamic thunks and listeners to terminate
3535
for (inp_chan,out_chan) in values(state.worker_chans)
36-
close(inp_chan)
37-
close(out_chan)
36+
# Closing these channels will fail if the worker died, which we
37+
# allow.
38+
try
39+
close(inp_chan)
40+
close(out_chan)
41+
catch ex
42+
if !(ex isa ProcessExitedException)
43+
rethrow()
44+
end
45+
end
3846
end
47+
3948
# Throw out of scheduler
4049
throw(SchedulerHaltedException())
4150
end

0 commit comments

Comments
 (0)