[erlang-questions] Why does the restart strategy "{one_for_one, 10, 10}" still kill my application?

Taavi Talvik <>
Wed Oct 4 19:55:08 CEST 2006


On Oct 4, 2006, at 8:33 PM, Shelton Tang wrote:

> Hi Gunilla,
>
> Thank you for the info. When I start erl with "erl -boot start_sasl",
> the last outuput shows the sup shutdown is because of one child
> shutdown. The child calls gen_tcp:listen/2 but got eaddrnotavail since
> i got a wrong IP from inet:getiflist.
>
> so my question is, do I need to trap_exit in my supervisor?

Your problem seems to be in application startup phase.

As principle:
	child init function should succeed and real work
	should be done in server "runtime" logic

	this allows supervisory hierarchy started and
	errors are later handled as normal runtime errors

	supervisor assumes, that initialization is lightweight
	operation - something like passing parameters

best regards,
taavi




More information about the erlang-questions mailing list