Skip to content

Commit 593ec26

Browse files
Merge pull request #13701 from rabbitmq/avoid-crash-on-federation-status
Avoid crash when reporting federation status
2 parents 9c23e7f + 6513d02 commit 593ec26

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

deps/rabbitmq_federation_management/src/rabbit_federation_mgmt.erl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,12 @@ format(Node, Info, Chs) ->
101101
[Ch || Ch <- Chs,
102102
pget(name, pget(connection_details, Ch))
103103
=:= pget(local_connection, Info)]) of
104-
[Ch] -> [{local_channel, Ch}];
104+
[Ch|_] ->
105+
%% we iterate on responses from many nodes; if the link
106+
%% was restarted on another node, we might get duplicates;
107+
%% we don't really know which one is the most up-to-date
108+
%% so let's just take the first one
109+
[{local_channel, Ch}];
105110
[] -> []
106111
end,
107112
[{node, Node} | format_info(Info)] ++ LocalCh.

0 commit comments

Comments
 (0)