"simple_one_for_one" supervisor childs termination problem

zabrane Mikael zabrane3@REDACTED
Tue Nov 30 11:58:40 CET 2010

Hi everybody,

I'm testing a "simple_one_for_one" supervisor (foo_sup.erl) to
supervise a bunch of workers (foo_srv.erl implemented as gen_server).
On the top of that, there's an application process (foo_app.erl) which
let me start/stop the entire application easily.
Everything went fine except the termination.

When calling "application:stop(foo_app)", the workers never get their
"terminate/2" function called.

Here's my supervisor (foo_sup.erl) init/1 function:
init([]) ->
    AChild = {foo_srv, {foo_srv, start_link, []},
                   transient, 180000, worker, [foo_srv]},
    Strategy = {simple_one_for_one, 10, 100},
    {ok, {Strategy, [AChild]}}.

Any help will be very appreciated!

N.B: it seems to me that the Erlang doc is also missing the fact the
atom 'infinity'
couldn't be use with simple_one_for_one. Am I right? So in this
example, I'm using a kill timeout of 3 minutes (18000).


More information about the erlang-questions mailing list