summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2014-07-25 14:43:47 +0100
committerSimon MacMullen <simon@rabbitmq.com>2014-07-25 14:43:47 +0100
commit00f7c16f36348107fc050d1ecb236e22d34f1014 (patch)
tree1f483a588b117ae57020c448135138cfe7007063 /src
parent5448b62f585533538c19db312942e8e0151e0893 (diff)
downloadrabbitmq-server-git-00f7c16f36348107fc050d1ecb236e22d34f1014.tar.gz
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!
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_misc.erl4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl
index 58e93a3f9e..1a9c8a418e 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).