Skip to content

Commit f8a9643

Browse files
Merge pull request #894 from lemenkov/toctou_in_cluster_status
Don't die in case of faulty node
2 parents 0c316fc + 5bcf3ba commit f8a9643

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/rabbit_control_main.erl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -953,6 +953,9 @@ nodes_in_cluster(Node) ->
953953
unsafe_rpc(Node, rabbit_mnesia, cluster_nodes, [running]).
954954

955955
alarms_by_node(Name) ->
956-
Status = unsafe_rpc(Name, rabbit, status, []),
957-
{_, As} = lists:keyfind(alarms, 1, Status),
958-
{Name, As}.
956+
case rpc_call(Name, rabbit, status, []) of
957+
{badrpc,nodedown} -> {Name, [nodedown]};
958+
Status ->
959+
{_, As} = lists:keyfind(alarms, 1, Status),
960+
{Name, As}
961+
end.

0 commit comments

Comments
 (0)