Skip to content

Commit a05bcb2

Browse files
authored
Fix world age issue with custom streams for Distributed workers (#42481)
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.
1 parent 6202475 commit a05bcb2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

stdlib/Distributed/src/remotecall.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,10 @@ function start_gc_msgs_task()
270270
# this might miss events
271271
wait(any_gc_flag)
272272
end
273-
flush_gc_msgs() # handles throws internally
273+
# Use invokelatest() so that custom message transport streams
274+
# for workers can be defined in a newer world age than the Task
275+
# which runs the loop here.
276+
invokelatest(flush_gc_msgs) # handles throws internally
274277
end
275278
end
276279
)

0 commit comments

Comments
 (0)