Skip to content

Commit

Permalink
Handle no available nodes to cluster with
Browse files Browse the repository at this point in the history
This came up when testing whether all nodes would wait for node 0
could not start. To test this, I was killing node 0 every few seconds,
so it would attempt to start and then get killed. This led to other
nodes sometimes discovering it and attempting to sync, but then crashing
with function_clause as it went away.
  • Loading branch information
mkuratczyk committed Jan 28, 2025
1 parent f549425 commit a3dae1f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions deps/rabbit/src/rabbit_peer_discovery.erl
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,12 @@ can_use_discovered_nodes(_DiscoveredNodes, []) ->
%%
%% @private

select_node_to_join([]) ->
?LOG_INFO(
"Peer discovery: no nodes available for auto-clustering; waiting before retrying...",
[],
#{domain => ?RMQLOG_DOMAIN_PEER_DISC}),
false;
select_node_to_join([{Node, _Members, _StartTime, _IsReady} | _])
when Node =:= node() ->
?LOG_INFO(
Expand Down

0 comments on commit a3dae1f

Please sign in to comment.