[erlang-questions] simple_one_for_one supervisor, transient restart strategy

Arif Ishaq <>
Thu Dec 13 16:06:09 CET 2012


 
Hi,

I have tried this with R15B and it works for me. 

In practice, I have the child implemented as a gen_server which handles messages stopnormal, stopshutdown and stopabort treated with {stop, normal, State}, {stop, shutdown, State} and {stop, abort, State} respectively. When I send the messages stopnormal or stopshutdown, the child dies without getting restarted. When I send a stopabort, it gets restarted with the arguments with which it was created.

Can you please post your code to see what went wrong? 

Regards
Arif


-----Original Message-----
From: Paul Peregud [mailto:] 
Sent: mercoledì 12 dicembre 2012 16.20
To: 
Subject: [erlang-questions] simple_one_for_one supervisor, transient restart strategy

I've searched mailing list for this question and found nothing.

There is this one peculiar behavior when you use simple_one_for_one with transient strategy. You do supervisor:start_child(Ref, Args), the child executes and if it dies gracefully everything is fine, child is removed from supervisor tree. However, if it fails, it is restarted WITHOUT Args.

This combination of type/strategy would be a great tool for fire-and-forget tasks if it was not for that small issue.

Is it a bug or is it a feature?

--
Best regards,
Paul Peregud
+48602112091




More information about the erlang-questions mailing list