summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@rabbitmq.com>2010-09-07 15:58:38 +0100
committerMatthew Sackman <matthew@rabbitmq.com>2010-09-07 15:58:38 +0100
commit549e84c250add08dbc408908175bbf7d3386738d (patch)
tree330a4226f674ef68c07b3b1a60384907fe0a0fd7
parenteac39cf28e194c55ae1b57793af3e21108244883 (diff)
downloadrabbitmq-server-bug23203.tar.gz
Treat an intrinsic supervisor child the same as an intrinsic non-supervisor child when it comes to 'normal' exit reasons (which, for a supervisor, is 'shutdown', not 'normal')bug23203
-rw-r--r--src/supervisor2.erl7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/supervisor2.erl b/src/supervisor2.erl
index 4a1c5832..93adfcb1 100644
--- a/src/supervisor2.erl
+++ b/src/supervisor2.erl
@@ -34,7 +34,9 @@
%% 4) Added an 'intrinsic' restart type. Like the transient type, this
%% type means the child should only be restarted if the child exits
%% abnormally. Unlike the transient type, if the child exits
-%% normally, the supervisor itself also exits normally.
+%% normally, the supervisor itself also exits normally. If the
+%% child is a supervisor and it exits normally (i.e. with reason of
+%% 'shutdown') then the child's parent also exits normally.
%%
%% All modifications are (C) 2010 Rabbit Technologies Ltd.
%%
@@ -545,6 +547,9 @@ do_restart(permanent, Reason, Child, State) ->
restart(Child, State);
do_restart(intrinsic, normal, Child, State) ->
{shutdown, state_del_child(Child, State)};
+do_restart(intrinsic, shutdown, Child = #child{child_type = supervisor},
+ State) ->
+ {shutdown, state_del_child(Child, State)};
do_restart(_, normal, Child, State) ->
NState = state_del_child(Child, State),
{ok, NState};