File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -634,7 +634,15 @@ function fetch(r::Future)
634634 # why? local put! performs caching and putting into channel under r.lock
635635
636636 # for local put! use the cached value, for call_on_owner cases just take the v_local as it was just cached in r.v
637- v_cache = status ? v_local : v_old
637+
638+ # remote calls getting the value from `call_on_owner` used to return the value directly without wrapping it in `Some(x)`
639+ # so we're doing the same thing here
640+ if status
641+ send_del_client (r)
642+ return v_local
643+ else # this `v_cache` is returned at the end of the function
644+ v_cache = v_old
645+ end
638646 end
639647
640648 send_del_client (r)
Original file line number Diff line number Diff line change @@ -841,6 +841,16 @@ v15406 = remotecall_wait(() -> 1, id_other)
841841fetch (v15406)
842842remotecall_wait (fetch, id_other, v15406)
843843
844+
845+ # issue #43396
846+ # Covers the remote fetch where the value returned is `nothing`
847+ # May be caused by attempting to unwrap a non-`Some` type with `something`
848+ # `call_on_owner` ref fetches return values not wrapped in `Some`
849+ # and have to be returned directly
850+ @test nothing === fetch (remotecall (() -> nothing , workers ()[1 ]))
851+ @test 10 === fetch (remotecall (() -> 10 , workers ()[1 ]))
852+
853+
844854# Test various forms of remotecall* invocations
845855
846856@everywhere f_args (v1, v2= 0 ; kw1= 0 , kw2= 0 ) = v1+ v2+ kw1+ kw2
You can’t perform that action at this time.
0 commit comments