[erlang-questions] Designing supervision trees

Bernard Duggan bernie@REDACTED
Thu May 6 02:11:44 CEST 2010


Hi Scott et al,

On 06/05/10 05:39, Scott Lystig Fritchie wrote:
> Stepping back to the general question of using supervisors, I recommend
> a bit of experimentation.  It usually isn't *too* hard to modify your
> supervisor hierarchy with a slightly different shape.
>    
It's already gone through several shapes as I've experimented :) I was 
more looking for guidence on the "erlang way" to think about the problem 
than a specific concrete solution.  The problem is not that I can't find 
a bunch of seemingly valid ways to do it, but that I'm afraid there's 
some considerations I haven't taken into account.

> Oh, and make certain that the 'sasl' application is running so you get
> some decent event logging when major processes are killed&  restarted.
>    
Good advice.  We already have that, plus our own logging system built 
upon it which allows us to split logs by application and also have 
separate specific logs for "extra bad" stuff like crashes - makes them 
easier to pick up amongst the less critical noise of debugging info.

> Then use the "Kill" button on the 'appmon' GUI to see what happens when
> you kill certain processes.  Or use kill/2 to kill them, if the GUI
> isn't convenient.  Then you'll see exactly how the supervisors react to
> a failure just about anywhere in your hierarchy.
>    
Appmon's 'kill' button was exactly how I was testing it :)  Good to know 
my approach is a sound one - thanks.

Thanks very much for everyone's suggestions.  In particular the 
supervisor_bridge behaviour - hadn't seen that before and hadn't quite 
noticed that not all my supervised processes were gen_somethings.  I 
think I'll just go and fix that now...

B


More information about the erlang-questions mailing list