[erlang-patches] Supervisor shutdown reason when reaching max restarts

Fredrik fredrik@REDACTED
Thu Jul 4 17:33:57 CEST 2013


On 07/04/2013 04:44 PM, Tobias Schlager wrote:
> Hi,
>
> this patch changes the behaviour of supervisors to exit with a more specific reason when exiting due to a maximum restart limit hit. This is especially useful (or even necessary) to distinguish between normal and erroneous process terminations when monitoring a supervisor from another process.
>
> In the above case a supervisor would now exit with {shutdown, {reached_max_restart_intensity, Child}} where Child is whatever is available to describe the child, either a child id or in case of a simple_one_for_one supervisor the offending child's process id. The patch should not affect the OTP restart behaviour (also for cascaded supervisors) since a subclass of 'normal' exit reasons is used.
>
> I'm aware that there is some potential backward incompatibility for people that do not expect {shutdown, Reason} when monitoring a supervisor. However, the feature of exiting normally with {shutdown, Reason} has been around for quite a while now and I think this could be a sensible place to use it. Let me know what you think.
>
> The patch does include tests and updated documentation.
>
>            git fetch https://github.com/schlagert/otp.git supervisor_shutdown_reason
>
>            https://github.com/schlagert/otp/compare/erlang:master...supervisor_shutdown_reason
>            https://github.com/schlagert/otp/compare/erlang:master...supervisor_shutdown_reason.patch
>
> Regards
> Tobias
> _______________________________________________
> erlang-patches mailing list
> erlang-patches@REDACTED
> http://erlang.org/mailman/listinfo/erlang-patches
Hello Tobias,
I've fetched your patch and assigned it to be reviewed by responsible team.
Thanks,

-- 

BR Fredrik Gustafsson
Erlang OTP Team




More information about the erlang-patches mailing list