From d328a827da2bcf5d82dc04fa1753b3127c6a6477 Mon Sep 17 00:00:00 2001 From: Amit Murthy Date: Tue, 25 Jul 2017 10:15:02 +0530 Subject: [PATCH] fix spurious exception printing on custom topologies (#22933) --- base/distributed/process_messages.jl | 9 ++++++--- test/topology.jl | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/base/distributed/process_messages.jl b/base/distributed/process_messages.jl index 1eba6eafd496d..be5eb7bcfc82a 100644 --- a/base/distributed/process_messages.jl +++ b/base/distributed/process_messages.jl @@ -196,11 +196,14 @@ function message_handler_loop(r_stream::IO, w_stream::IO, incoming::Bool) end catch e # Check again as it may have been set in a message handler but not propagated to the calling block above - wpid = worker_id_from_socket(r_stream) - if (wpid < 1) + if wpid < 1 + wpid = worker_id_from_socket(r_stream) + end + + if wpid < 1 println(STDERR, e, CapturedException(e, catch_backtrace())) println(STDERR, "Process($(myid())) - Unknown remote, closing connection.") - else + elseif !(wpid in map_del_wrkr) werr = worker_from_id(wpid) oldstate = werr.state set_worker_state(werr, W_TERMINATED) diff --git a/test/topology.jl b/test/topology.jl index 52cf1bfa29be3..09865652984e6 100644 --- a/test/topology.jl +++ b/test/topology.jl @@ -21,7 +21,7 @@ end function remove_workers_and_test() while nworkers() > 0 - rmprocs(workers()[1]; waitfor=2.0) + rmprocs(workers()[1]) test_worker_counts() if nworkers() == nprocs() break