Blob Blame History Raw
From: Peter Lemenkov <lemenkov@redhat.com>
Date: Fri, 22 Jul 2016 17:15:02 +0200
Subject: [PATCH] Don't die in case of faulty node

Signed-off-by: Peter Lemenkov <lemenkov@redhat.com>

diff --git a/src/rabbit_control_main.erl b/src/rabbit_control_main.erl
index 1a98dcc..9621af8 100644
--- a/src/rabbit_control_main.erl
+++ b/src/rabbit_control_main.erl
@@ -975,6 +975,9 @@ nodes_in_cluster(Node, Timeout) ->
     unsafe_rpc(Node, rabbit_mnesia, cluster_nodes, [running], Timeout).
 
 alarms_by_node(Name) ->
-    Status = unsafe_rpc(Name, rabbit, status, []),
-    {_, As} = lists:keyfind(alarms, 1, Status),
-    {Name, As}.
+    case rpc_call(Name, rabbit, status, []) of
+        {badrpc,nodedown} -> {Name, [nodedown]};
+        Status ->
+            {_, As} = lists:keyfind(alarms, 1, Status),
+            {Name, As}
+    end.