[erlang-questions] Supervisor behaviour

Martin Dimitrov mrtndimitrov@REDACTED
Tue May 3 13:37:50 CEST 2011


Thanks.

I think I got it. one_for_all means *all* child processes will be
restarted no matter their type but temporary processes will not trigger
a restart. It makes sense now. Thanks for the help.

Regards,

Martin

On 5/3/2011 2:26 PM, Frédéric Trottier-Hébert wrote:
> First point regarding one_for_all restarting all children: you specify you want all children restarted and that's exactly what happens. This is, as far as I know, the normal behaviour. 
> Secondly, the other processes are not restarted when a temporary process crashes because temporary processes are expected to crash -- permanent processes will always trigger a restart, transient processes will trigger a restart if they terminated abnormally and temporary processes will never trigger one.
>
> My suggestion if you want to restart your failing temporary process is to make them transient.
>
>  If, however, you don't want them to be restarted when a permanent process fail, I might suggest you try splitting them into different supervisors with different restart strategies. It's hard to say without knowing what your application is doing, but when you have conflicts in restart strategy, it might mean you are unclear on the responsibilities of each supervisor in terms of isolating processes from each other.
>
> --
> Fred Hébert
> http://www.erlang-solutions.com




More information about the erlang-questions mailing list