summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Klishin <mklishin@pivotal.io>2020-01-13 20:42:21 +0300
committerGitHub <noreply@github.com>2020-01-13 20:42:21 +0300
commit5576cbc781dc1e2eeb1d1d3773ad6d60daacdec7 (patch)
tree6d3b1b732b3254d7532e0d75766968a25ad04509 /src
parent5d32f7edc9afbc0f397e37b25e482071cee00c70 (diff)
parent8ff98742d0d8ed5b64233d1bb9cf63b5a0c0d0e4 (diff)
downloadrabbitmq-server-git-5576cbc781dc1e2eeb1d1d3773ad6d60daacdec7.tar.gz
Merge pull request #2209 from rabbitmq/tomyouyou-tomyouyou-autoheal-l
Autoheal: the "autoheal_safe_to_start" state transition is not guaranteed to arrive on time
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_autoheal.erl6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/rabbit_autoheal.erl b/src/rabbit_autoheal.erl
index 77165fc26c..316c8c89cb 100644
--- a/src/rabbit_autoheal.erl
+++ b/src/rabbit_autoheal.erl
@@ -372,6 +372,7 @@ wait_for_supervisors(Monitors) ->
restart_loser(State, Winner) ->
rabbit_log:warning(
"Autoheal: we were selected to restart; winner is ~p~n", [Winner]),
+ NextStateTimeout = application:get_env(rabbit, autoheal_state_transition_timeout, 60000),
rabbit_node_monitor:run_outside_applications(
fun () ->
MRef = erlang:monitor(process, {?SERVER, Winner}),
@@ -381,6 +382,11 @@ restart_loser(State, Winner) ->
not_healing;
autoheal_safe_to_start ->
State
+ after NextStateTimeout ->
+ rabbit_log:warning(
+ "Autoheal: timed out waiting for a safe-to-start message from the winner (~p); will retry",
+ [Winner]),
+ not_healing
end,
erlang:demonitor(MRef, [flush]),
%% During the restart, the autoheal state is lost so we