[erlang-questions] Supervisor "spin rates"

Mike Oxford moxford@REDACTED
Thu Apr 14 00:15:14 CEST 2011


I create a socket_sup which supervises a listener socket.
Socket tries to bind, fails .. let it crash...super restarts.
Tries to bind, fails, let it crash...
Repeat ad nauseam until every supervisor all the way up is dead.

I don't see a way for the supervisor to check the child return code to say
"whoa, I know I'm supposed to restart this but
my child just told me it's simply not doable."

Is the "right way" to set it to simple_one_for_one transient, fail the bind,
log the error and then terminate "successfully" so the child doesn't
get restarted?  Set it to simple_one_for_one and "never restart," throw an
error to the caller and forget about supervision ...?

Yeah, I know it "should never happen" but once it's in production and out of
dev-hands...who knows what'll happen in a given configuration
file (or during a restart/move.)


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110413/a6eeed16/attachment.htm>

More information about the erlang-questions mailing list