Skip to content

Commit b0d2ad2

Browse files
JamesWrigleyjpsamaroo
authored andcommitted
Allow for dead workers in safepoint()
1 parent 1fc9908 commit b0d2ad2

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
@@ -32,9 +32,18 @@ function safepoint(state)
3232
if state.halt.set
3333
# Force dynamic thunks and listeners to terminate
3434
for (inp_chan,out_chan) in values(state.worker_chans)
35-
close(inp_chan)
36-
close(out_chan)
35+
# Closing these channels will fail if the worker died, which we
36+
# allow.
37+
try
38+
close(inp_chan)
39+
close(out_chan)
40+
catch ex
41+
if !(ex isa ProcessExitedException)
42+
rethrow()
43+
end
44+
end
3745
end
46+
3847
# Throw out of scheduler
3948
throw(SchedulerHaltedException())
4049
end

0 commit comments

Comments
 (0)