@@ -75,7 +75,7 @@ function run_work_thunk(thunk::Function, print_error::Bool)
7575 end
7676 return result
7777end
78- function run_work_thunk (rv:: RemoteValue , thunk)
78+ function run_work_thunk_remotevalue (rv:: RemoteValue , thunk)
7979 put! (rv, run_work_thunk (thunk, false ))
8080 nothing
8181end
@@ -85,7 +85,7 @@ function schedule_call(rid, thunk)
8585 rv = RemoteValue (def_rv_channel ())
8686 (PGRP:: ProcessGroup ). refs[rid] = rv
8787 push! (rv. clientset, rid. whence)
88- errormonitor (@async run_work_thunk (rv, thunk))
88+ errormonitor (@async run_work_thunk_remotevalue (rv, thunk))
8989 return rv
9090 end
9191end
@@ -289,7 +289,7 @@ function handle_msg(msg::CallMsg{:call_fetch}, header, r_stream, w_stream, versi
289289 try
290290 deliver_result (w_stream, :call_fetch , header. notify_oid, v. v)
291291 finally
292- unlock (v. rv. synctake)
292+ unlock (v. rv. synctake:: ReentrantLock )
293293 end
294294 else
295295 deliver_result (w_stream, :call_fetch , header. notify_oid, v)
@@ -315,8 +315,10 @@ function handle_msg(msg::ResultMsg, header, r_stream, w_stream, version)
315315end
316316
317317function handle_msg (msg:: IdentifySocketMsg , header, r_stream, w_stream, version)
318+ throw_if_cluster_manager_unassigned ()
319+
318320 # register a new peer worker connection
319- w = Worker (msg. from_pid, r_stream, w_stream, cluster_manager; version= version)
321+ w = Worker (msg. from_pid, r_stream, w_stream, cluster_manager[] ; version= version):: Worker
320322 send_connection_hdr (w, false )
321323 send_msg_now (w, MsgHeader (), IdentifySocketAckMsg ())
322324 notify (w. initialized)
@@ -328,8 +330,10 @@ function handle_msg(msg::IdentifySocketAckMsg, header, r_stream, w_stream, versi
328330end
329331
330332function handle_msg (msg:: JoinPGRPMsg , header, r_stream, w_stream, version)
333+ throw_if_cluster_manager_unassigned ()
334+
331335 LPROC. id = msg. self_pid
332- controller = Worker (1 , r_stream, w_stream, cluster_manager; version= version)
336+ controller = Worker (1 , r_stream, w_stream, cluster_manager[] ; version= version):: Worker
333337 notify (controller. initialized)
334338 register_worker (LPROC)
335339 topology (msg. topology)
@@ -348,9 +352,9 @@ function handle_msg(msg::JoinPGRPMsg, header, r_stream, w_stream, version)
348352 let rpid= rpid, wconfig= wconfig
349353 if lazy
350354 # The constructor registers the object with a global registry.
351- Worker (rpid, ()-> connect_to_peer (cluster_manager, rpid, wconfig))
355+ Worker (rpid, ()-> connect_to_peer (cluster_manager[] , rpid, wconfig))
352356 else
353- @async connect_to_peer (cluster_manager, rpid, wconfig)
357+ @async connect_to_peer (cluster_manager[] , rpid, wconfig)
354358 end
355359 end
356360 end
362366function connect_to_peer (manager:: ClusterManager , rpid:: Int , wconfig:: WorkerConfig )
363367 try
364368 (r_s, w_s) = connect (manager, rpid, wconfig)
365- w = Worker (rpid, r_s, w_s, manager; config= wconfig)
369+ w = Worker (rpid, r_s, w_s, manager; config= wconfig):: Worker
366370 process_messages (w. r_stream, w. w_stream, false )
367371 send_connection_hdr (w, true )
368372 send_msg_now (w, MsgHeader (), IdentifySocketMsg (myid ()))
0 commit comments