diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2014-07-25 14:43:47 +0100 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2014-07-25 14:43:47 +0100 |
commit | c60a603347517bf31304008a7f485142f1711db5 (patch) | |
tree | 1f483a588b117ae57020c448135138cfe7007063 | |
parent | 2b1181e55bb2372cf65cea5df1895001b301c10c (diff) | |
download | rabbitmq-server-c60a603347517bf31304008a7f485142f1711db5.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!
-rw-r--r-- | src/rabbit_misc.erl | 4 |
1 files changed, 3 insertions, 1 deletions
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). |