[erlang-questions] How to make a supervisor wait before restarting children

Ulf Wiger ulf@REDACTED
Wed Sep 12 12:36:15 CEST 2012


I agree with Loic's advice.

Lobbying for a change of the supervisor semantics is not likely 
to produce tangible (esp. short-term) results, and for good reason.
The supervisor behaviour is so central, that even subtle changes
in semantics can have serious unintended consequences.

FWIW, I have lobbied for changes myself in the past, see e.g.
ftp://ftp.it.su.se/pub/mirrors/www.erlang.org/ml-archive/erlang-questions/200311/msg00247.html

BR,
Ulf W

On 12 Sep 2012, at 11:58, Florian Odronitz wrote:

> Hi List,
> 
> I am writing an application to talk to a database server. The supervisor starts a bunch of workers which connect to the db.
> When the db is not available, the workers crash and are restarted by the backend. If the workers crash too often, the supervisor dies according to the restart strategy. When the db comes up again after a couple of minutes, the supervisor is long dead.
> 
> What I would like to achieve is a (super)supervisor that waits for a couple of seconds before restarting workers (or supervisor). The restart strategy does not offer such an option.
> Do you have any idea how to do this?
> 
> Thanks,
> Florian
> 
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc.
http://feuerlabs.com






More information about the erlang-questions mailing list