[erlang-patches] Add supervisor:start_child/3 to limit the number of children

Siri Hansen <>
Tue Apr 9 16:10:27 CEST 2013


Hi Vance!

Is this feature mostly for use with simple_one_for_one supervisors? I
believe (possibly faulty??) that these are the most common supervisor for
which many children are repeatedly restarted as a part of normal execution.
Could you say something more about your use case? Other input on this?

Regarding the implementation, one could say that the behavior differs a
little bit for different types of supervisors and child restart types.
(This is of course due to the nature of the supervisor/child types):

* simple_one_for_one supervisor (all child restart types) -> Limit is
compared to the number of alive children.
* other supervisor type, temporary children -> Limit is compared to the
number of alive children.
* other supervisor type, non-temporary children -> Limit is compared to the
number of child specs.

The very least we need to consider is if this is the correct behavior, and
if so I think it needs to be mentioned in the documentation. Or should the
feature be restricted to simple_one_for_one supervisors (or is it only me?)?

Regards

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-patches/attachments/20130409/4279a647/attachment.html>


More information about the erlang-patches mailing list