[erlang-questions] Restarting registered processes

Ulf Wiger <>
Mon Jun 7 11:26:48 CEST 2010


Hi Michal,

I'm not entirely sure that this is a realistic case.
What you are simulating is a bug in the supervisor, as
far as I can tell (by killing it - with exit(SUP,kill)?).

Normally, when a supervisor terminates, it will verify that
all children are in fact dead before terminating itself.

BR,
Ulf W


Michal Ptaszek wrote:
> Hi,
> 
> I was wondering what is the best way to handle the following
> situation.
> 
> There is an application with main app's supervisor, under which 
> we have additional sup (let's call it SUP), that has ~100 children, 
> each one of them is a registered process (for now assume it is 
> necessary to have them all registered). 
> 
> In the test scenario, we kill SUP and expect the main app supervisor
> to restart it. Of course, when SUP dies it sends exit signals to 
> all its children which should die as well (they do not have 
> trap_exit flag set). As soon as they exit, their references should
> be removed from the registered processes table. 
> 
> Unfortunately it turns out that SUP is restarted before all the 
> children from previous epoch manage to shut down (process the exit 
> signal). Because of that new children get badarg when they try to
> register themselves, SUP restarts again and again, until it reaches 
> the max_restart_intensity: then whole application collapses.
> 
> Do you have any idea how to solve this problem?
> 
> I will be grateful for any hint. 
> 
> Best regards,
> Michal Ptaszek 

-- 
Ulf Wiger
CTO, Erlang Solutions Ltd, formerly Erlang Training & Consulting Ltd
http://www.erlang-solutions.com
---------------------------------------------------

---------------------------------------------------

WE'VE CHANGED NAMES!

Since January 1st 2010 Erlang Training and Consulting Ltd. has become ERLANG SOLUTIONS LTD.

www.erlang-solutions.com



More information about the erlang-questions mailing list