Restarting registered processes

Michal Ptaszek michal.ptaszek@REDACTED
Mon Jun 7 10:45:17 CEST 2010


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 
---------------------------------------------------

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

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