Skip to content

Commit ecf3549

Browse files
Ayanda-Dmichaelklishin
authored andcommitted
handle autoheal winner_waiting state with a chosen winner to avoid crashing node monitor
1 parent 43dfa4d commit ecf3549

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

deps/rabbit/src/rabbit_autoheal.erl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,12 @@ handle_msg({winner_is, Winner}, State = {leader_waiting, Winner, _},
263263
%% This node is the leader and a loser at the same time.
264264
Pid = restart_loser(State, Winner),
265265
{restarting, Pid};
266+
handle_msg({winner_is, Winner}, State = {winner_waiting, _OutstandingStops, _Notify},
267+
_Partitions) ->
268+
%% This node is still in winner_waiting with a winner reported, restart loser
269+
%% and update state
270+
Pid = restart_loser(State, Winner),
271+
{restarting, Pid};
266272

267273
handle_msg(Request, {restarting, Pid} = St, _Partitions) ->
268274
%% ignore, we can contribute no further

0 commit comments

Comments
 (0)