[erlang-questions] "simple_one_for_one" supervisor childs termination problem

zabrane Mikael zabrane3@REDACTED
Tue Nov 30 13:40:09 CET 2010


Hi Lucas,

2010/11/30 Lukas Larsson <garazdawi@REDACTED>:
> When terminating a child the supervisor calls exit(Pid,shutdown). When a
> process receives an exit signal it will automatically die unless it is
> trapping exits. So in order for terminate to be called before the process
> dies you have to trap exits within the child process.

I forgot to mention that I'm already traping exit in "foo_srv.erl":
%% --- gen server callbacks
init(Args) ->
    process_flag(trap_exit, true),
    {ok, Args}.

Even with that, the worker process never get the "shutdown" EXIT message.

-- 
Regards
Zabrane


More information about the erlang-questions mailing list