diff options
author | James Fish <[email protected]> | 2015-03-04 23:10:25 +0000 |
---|---|---|
committer | Zandra Hird <[email protected]> | 2015-05-26 12:27:15 +0200 |
commit | 000c33662b8a98870a97a3499076895d4e832563 (patch) | |
tree | 011cccbc70aaf650c153c3eb7ffbf6ac3a944b9b /lib/stdlib/src | |
parent | 4034b89a07a97766dba5e6213b1eb4d76ba6df9e (diff) | |
download | otp-000c33662b8a98870a97a3499076895d4e832563.tar.gz otp-000c33662b8a98870a97a3499076895d4e832563.tar.bz2 otp-000c33662b8a98870a97a3499076895d4e832563.zip |
Don't store child that returns ignore in simple supervisor
If a child of a simple_one_for_one returns ignore from its start
function no longer store the child for any restart type. It is not
possible to restart or delete the child because the supervisor is a
simple_one_for_one.
Previously a simple_one_for_one would crash, potentially without
shutting down all of its children, when it tried to shutdown a child
with undefined pid.
Previous only one undefined pid child was stored in a simple_one_for_one
supervisor no matter how many times the child start function returned
ignore.
Diffstat (limited to 'lib/stdlib/src')
-rw-r--r-- | lib/stdlib/src/supervisor.erl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/stdlib/src/supervisor.erl b/lib/stdlib/src/supervisor.erl index 67655b1145..1d7396adee 100644 --- a/lib/stdlib/src/supervisor.erl +++ b/lib/stdlib/src/supervisor.erl @@ -381,7 +381,7 @@ handle_call({start_child, EArgs}, _From, State) when ?is_simple(State) -> #child{mfargs = {M, F, A}} = Child, Args = A ++ EArgs, case do_start_child_i(M, F, Args) of - {ok, undefined} when Child#child.restart_type =:= temporary -> + {ok, undefined} -> {reply, {ok, undefined}, State}; {ok, Pid} -> NState = save_dynamic_child(Child#child.restart_type, Pid, Args, State), |