Merge pull request #6719 from cloudamqp/badrpc_listeners

Don't crash listing listeners when a node is shutting down
This commit is contained in:
Michael Klishin 2022-12-21 00:42:01 +04:00 committed by GitHub
commit 2ceb0b6694
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -467,8 +467,13 @@ node_listeners_mnesia(Node) ->
node_listeners_ets(Node) ->
case rabbit_misc:rpc_call(Node, ets, tab2list, [?ETS_TABLE]) of
{badrpc, nodedown} -> [];
Listeners -> Listeners
{badrpc, _} ->
%% Some of the reasons are the node being down or is
%% shutting down and the ETS table does not exist any
%% more.
[];
Listeners when is_list(Listeners) ->
Listeners
end.
-spec node_client_listeners(node()) -> [rabbit_types:listener()].