EEP proposal - Automatic supervisor shutdown triggered by termination of significant childs

José Valim jose.valim@REDACTED
Thu Mar 4 16:45:49 CET 2021


Thanks for sharing. I have read the proposal and I think it describes the
problem well!

I have only one minor comment on the proposed solution, which is this:

> The new supervisor flag is named shutdown with possible values normal,
any_significantand all_significant, with normal being the default.

I don't like "normal" being the default because now I have to remember to
change two places, the supervisor specification and the child spec, when
configuring a significant child. The argument for this choice was:

> With the supervisor shutdown flag set to normal, the child spec flag
significant is ignored, even if present and set to true. This is intended
as a safety means to defend against unwanted breaking of old code.

I don't think it is possible for old code to break because there is no old
code using significant in a child spec. :)

Therefore I would propose for the default to be either any_significant or
all_significant (if we want to be conversative, the latter). If we really
think a default of normal is necessary, then I would propose to at least
warn if the supervisor is normal and a significant child is given, as that
will eventually save someone from debugging why the significant flag is not
working as expected. :)

I also think #{shutdown => normal} in a supervisor spec can be confusing,
because someone may think it is customizing the exit reason of the
supervisor, which is typically shutdown (and not normal). If normal is no
longer the default, you could remove the normal option altogether, but if
you want to keep it, perhaps something like ignore_significant is clearer?

Thank you!

On Thu, Mar 4, 2021 at 3:52 PM Maria Scott <maria-12648430@REDACTED>
wrote:

> Hello,
>
> in the course of discussion around PR #4521
> <https://github.com/erlang/otp/pull/4521> in OTP, it was decided by the
> OTP Technical Board that the PR will need an EEP. So here it is. We hope we
> did everything right, we tried hard to be clear, precise and exhaustive,
> and adhere to the requirements outlined in EEPs 1 and 33. But this is our
> first EEP ever, so... ^^;
>
> Kind regards,
>     Maria Scott
>     Jan Uhlig
> _______________________________________________
> eeps mailing list
> eeps@REDACTED
> http://erlang.org/mailman/listinfo/eeps
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/eeps/attachments/20210304/f83632fc/attachment.htm>


More information about the eeps mailing list