Skip to content

Commit

Permalink
Fix world age issue with custom streams for Distributed workers (#42481)
Browse files Browse the repository at this point in the history
If connect(::CustomClusterManager, ...) returns a custom transport
stream, use of that stream by the task in start_gc_msgs_task() may fail
due to the task executing in an old world age. Add an invokelatest() to
prevent this problem.

(cherry picked from commit a05bcb2)
  • Loading branch information
c42f authored and KristofferC committed Dec 7, 2021
1 parent d8d1239 commit 417050b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion stdlib/Distributed/src/remotecall.jl
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,10 @@ const any_gc_flag = Condition()
function start_gc_msgs_task()
@async while true
wait(any_gc_flag)
flush_gc_msgs()
# Use invokelatest() so that custom message transport streams
# for workers can be defined in a newer world age than the Task
# which runs the loop here.
invokelatest(flush_gc_msgs) # handles throws internally
end
end

Expand Down

0 comments on commit 417050b

Please sign in to comment.