From ecf3549c52d1c38b1bbd7938ce534dd23dda3474 Mon Sep 17 00:00:00 2001 From: Ayanda Dube Date: Fri, 27 Oct 2023 16:02:40 +0100 Subject: [PATCH] handle autoheal winner_waiting state with a chosen winner to avoid crashing node monitor --- deps/rabbit/src/rabbit_autoheal.erl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/deps/rabbit/src/rabbit_autoheal.erl b/deps/rabbit/src/rabbit_autoheal.erl index c17d9fd7c0a..87887a9dda7 100644 --- a/deps/rabbit/src/rabbit_autoheal.erl +++ b/deps/rabbit/src/rabbit_autoheal.erl @@ -263,6 +263,12 @@ handle_msg({winner_is, Winner}, State = {leader_waiting, Winner, _}, %% This node is the leader and a loser at the same time. Pid = restart_loser(State, Winner), {restarting, Pid}; +handle_msg({winner_is, Winner}, State = {winner_waiting, _OutstandingStops, _Notify}, + _Partitions) -> + %% This node is still in winner_waiting with a winner reported, restart loser + %% and update state + Pid = restart_loser(State, Winner), + {restarting, Pid}; handle_msg(Request, {restarting, Pid} = St, _Partitions) -> %% ignore, we can contribute no further