summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2014-07-14 17:23:53 +0100
committerSimon MacMullen <simon@rabbitmq.com>2014-07-14 17:23:53 +0100
commit5090d6984085aa3e893b634512996103780b878c (patch)
tree11d2dbaa7bef877a032de2b5ab7ac4ea7a3cb4e1 /src
parentc991045c5e01a1d921b1a2ddfe3f1c5f637125ad (diff)
downloadrabbitmq-server-git-5090d6984085aa3e893b634512996103780b878c.tar.gz
It's probably a good idea to reset "restarts" after we get the message, not when we send it; we don't want to jump back into restarting things as normal just because we have scheduled a restart.
Diffstat (limited to 'src')
-rw-r--r--src/supervisor2.erl7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/supervisor2.erl b/src/supervisor2.erl
index 90fb042379..4536a72eba 100644
--- a/src/supervisor2.erl
+++ b/src/supervisor2.erl
@@ -680,11 +680,12 @@ handle_info({'EXIT', Pid, Reason}, State) ->
handle_info({delayed_restart, {RestartType, Reason, Child}}, State)
when ?is_simple(State) ->
- try_restart(RestartType, Reason, Child, State);
+ try_restart(RestartType, Reason, Child, State#state{restarts = []});
handle_info({delayed_restart, {RestartType, Reason, Child}}, State) ->
case get_child(Child#child.name, State) of
{value, Child1} ->
- try_restart(RestartType, Reason, Child1, State);
+ try_restart(RestartType, Reason, Child1,
+ State#state{restarts = []});
_What ->
{noreply, State}
end;
@@ -917,7 +918,7 @@ do_restart_delay({RestartType, Delay}, Reason, Child, State) ->
_TRef = erlang:send_after(trunc(Delay*1000), self(),
{delayed_restart,
{{RestartType, Delay}, Reason, Child}}),
- {ok, state_del_child(Child, State#state{restarts = []})}
+ {ok, state_del_child(Child, State)}
end.
restart(Child, State) ->