From c60a603347517bf31304008a7f485142f1711db5 Mon Sep 17 00:00:00 2001 From: Simon MacMullen Date: Fri, 25 Jul 2014 14:43:47 +0100 Subject: Don't allow rabbit_misc:is_process_alive/1 to hang indefinitely if a node is incommunicado; we use this in rabbit_amqqueue:on_node_down/1 in a loop! --- src/rabbit_misc.erl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl index 58e93a3f..1a9c8a41 100644 --- a/src/rabbit_misc.erl +++ b/src/rabbit_misc.erl @@ -900,7 +900,9 @@ ntoab(IP) -> end. is_process_alive(Pid) -> - rpc:call(node(Pid), erlang, is_process_alive, [Pid]) =:= true. + Node = node(Pid), + lists:member(Node, [node() | nodes()]) andalso + rpc:call(Node, erlang, is_process_alive, [Pid]) =:= true. pget(K, P) -> proplists:get_value(K, P). pget(K, P, D) -> proplists:get_value(K, P, D). -- cgit v1.2.1