Skip to content

Commit 2a28e57

Browse files
authored
Merge pull request #645 from JuliaParallel/jps/sch-quiet-put-failure
Sch: Quietly fail to put do_tasks exception
2 parents 53f0537 + ee03046 commit 2a28e57

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/sch/Sch.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,9 @@ function (ets::FireTaskSpec)()
905905
bt = catch_backtrace()
906906
# FIXME: Catch the correct task ID
907907
thunk_id = first_task.thunk_id
908-
put!(chan, TaskResult(pid, proc, thunk_id, CapturedException(err, bt), nothing))
908+
if isopen(chan)
909+
put!(chan, TaskResult(pid, proc, thunk_id, CapturedException(err, bt), nothing))
910+
end
909911
finally
910912
@maybelog ctx timespan_finish(ctx, :fire, (;uid, worker=pid), nothing)
911913
end

src/utils/reuse.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,8 +587,8 @@ function reusable_task_loop(chan::Channel{Any}, ready::Threads.Atomic{Bool})
587587
while true
588588
f = try
589589
take!(chan)
590-
catch
591-
if !isopen(chan)
590+
catch err
591+
if !isopen(chan) || err isa InterruptException # scheduler exiting
592592
return
593593
else
594594
rethrow()

0 commit comments

Comments
 (0)