Skip to content

Commit 9f6459f

Browse files
authored
Fix JET errors around matching methods for lock(...) and unlock(...) (#167)
``` ┌ put_ref(rid::Distributed.RRID, caller::Int64, args::WeakRef) @ Distributed /workpath/Distributed.jl/src/remotecall.jl:709 │ no matching method found `lock(::Nothing)` (1/2 union split): Distributed.lock((rv::Distributed.RemoteValue).synctake::Union{Nothing, ReentrantLock}) └──────────────────── ``` ``` ┌ put_ref(rid::Distributed.RRID, caller::Int64, args::WeakRef) @ Distributed /workpath/Distributed.jl/src/remotecall.jl:710 │ no matching method found `unlock(::Nothing)` (1/2 union split): Distributed.unlock((rv::Distributed.RemoteValue).synctake::Union{Nothing, ReentrantLock}) ││││││││││││││└──────────────────── ``` ``` ┌ take_ref(rid::Any, caller::Any, args::Vararg{Any}) @ Distributed /workpath/Distributed.jl/src/remotecall.jl:734 │ no matching method found `lock(::Nothing)` (1/2 union split): Distributed.lock((rv::Distributed.RemoteValue).synctake::Union{Nothing, ReentrantLock}) └──────────────────── ``` ``` ┌ take_ref(rid::Any, caller::Any, args::Vararg{Any}) @ Distributed /workpath/Distributed.jl/src/remotecall.jl:742 │ no matching method found `unlock(::Nothing)` (1/2 union split): Distributed.unlock((rv::Distributed.RemoteValue).synctake::Union{Nothing, ReentrantLock}) └──────────────────── ``` ``` ┌ (::Distributed.var"#handle_msg##2#handle_msg##3"{Distributed.CallMsg{…}, Distributed.MsgHeader, Base.PipeEndpoint})() @ Distributed /workpath/Distributed.jl/src/process_messages.jl:292 │ no matching method found `unlock(::Nothing)` (1/2 union split): Distributed.unlock(((v::Distributed.SyncTake).rv::Distributed.RemoteValue).synctake::Union{Nothing, ReentrantLock}) └──────────────────── ``` (cherry picked from commit 01027d1)
1 parent 9724553 commit 9f6459f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/process_messages.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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)

src/remotecall.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -706,8 +706,8 @@ function put_ref(rid, caller, args...)
706706
put!(rv, args...)
707707
if myid() == caller && rv.synctake !== nothing
708708
# Wait till a "taken" value is serialized out - github issue #29932
709-
lock(rv.synctake)
710-
unlock(rv.synctake)
709+
lock(rv.synctake::ReentrantLock)
710+
unlock(rv.synctake::ReentrantLock)
711711
end
712712
nothing
713713
end
@@ -731,15 +731,15 @@ function take_ref(rid, caller, args...)
731731
# special handling for local put! / remote take! on unbuffered channel
732732
# github issue #29932
733733
synctake = true
734-
lock(rv.synctake)
734+
lock(rv.synctake::ReentrantLock)
735735
end
736736

737737
v = try
738738
take!(rv, args...)
739739
catch e
740740
# avoid unmatched unlock when exception occurs
741741
# github issue #33972
742-
synctake && unlock(rv.synctake)
742+
synctake && unlock(rv.synctake::ReentrantLock)
743743
rethrow(e)
744744
end
745745

0 commit comments

Comments
 (0)