Skip to content

Commit

Permalink
fix #19467, handle InterruptException in wait called from finished …
Browse files Browse the repository at this point in the history
…tasks (#24196)
  • Loading branch information
JeffBezanson authored Oct 20, 2017
1 parent 31f9987 commit db91082
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion base/task.jl
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,20 @@ function task_done_hook(t::Task)
end
# Clear sigatomic before waiting
sigatomic_end()
wait() # this will not return
try
wait() # this will not return
catch e
# If an InterruptException happens while blocked in the event loop, try handing
# the exception to the REPL task since the current task is done.
# issue #19467
if isa(e,InterruptException) && isdefined(Base,:active_repl_backend) &&
active_repl_backend.backend_task.state == :runnable && isempty(Workqueue) &&
active_repl_backend.in_eval
throwto(active_repl_backend.backend_task, e)
else
rethrow(e)
end
end
end


Expand Down

0 comments on commit db91082

Please sign in to comment.