Skip to content

Commit 8b3c67b

Browse files
amitmurthytkelman
authored andcommitted
fix error on exit for an invalid remote reference
(backport of d546f9a)
1 parent bf4eeab commit 8b3c67b

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

base/multi.jl

+2-8
Original file line numberDiff line numberDiff line change
@@ -559,11 +559,7 @@ end
559559
function send_del_client(rr::RemoteRef)
560560
if rr.where == myid()
561561
del_client(rr2id(rr), myid())
562-
else
563-
if in(rr.where, map_del_wrkr)
564-
# for a removed worker, don't bother
565-
return
566-
end
562+
elseif rr.where in procs() # process only if a valid worker
567563
w = worker_from_id(rr.where)
568564
push!(w.del_msgs, (rr2id(rr), myid()))
569565
w.gcflag = true
@@ -572,7 +568,6 @@ function send_del_client(rr::RemoteRef)
572568
end
573569

574570
function add_client(id, client)
575-
#println("$(myid()) adding client $client to $id")
576571
rv = lookup_ref(id)
577572
push!(rv.clientset, client)
578573
nothing
@@ -587,12 +582,11 @@ end
587582
function send_add_client(rr::RemoteRef, i)
588583
if rr.where == myid()
589584
add_client(rr2id(rr), i)
590-
elseif i != rr.where
585+
elseif (i != rr.where) && (rr.where in procs())
591586
# don't need to send add_client if the message is already going
592587
# to the processor that owns the remote ref. it will add_client
593588
# itself inside deserialize().
594589
w = worker_from_id(rr.where)
595-
#println("$(myid()) adding $((rr2id(rr), i)) for $(rr.where)")
596590
push!(w.add_msgs, (rr2id(rr), i))
597591
w.gcflag = true
598592
notify(any_gc_flag)

0 commit comments

Comments
 (0)