Erlang/OTP Forums

Author Message

<  Erlang patches mailing list  ~  Supervisor transient workers restart strategy fix

Guest
Posted: Fri Oct 29, 2010 11:19 am Reply with quote
Guest
Hi,

we have found the following inconsistency in the supervisor.erl code:
when supervisor's child restart strategy is set to transient and the child exits with reason shutdown, it is never restarted.

The patches include fix for the issue and the test suite used for reproducing the error, and later, after patching, for verifying the correctness of the code.

The patches are available here:
git fetch git@github.com:paulgray/otp.git
supervisor_transient_children_fix

Best regards,
Michal Ptaszek
________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
Guest
Posted: Fri Oct 29, 2010 1:36 pm Reply with quote
Guest
On Fri, Oct 29, 2010 at 1:19 PM, Michal Ptaszek
<michal.ptaszek@erlang-solutions.com> wrote:
> Hi,
>
> we have found the following inconsistency in the supervisor.erl code:
> when supervisor's child restart strategy is set to transient and the child exits with reason shutdown, it is never restarted.
>
> The patches include fix for the issue and the test suite used for reproducing the error, and later, after patching, for verifying the correctness of the code.
>
> The patches are available here:
> git fetch git@github.com:paulgray/otp.git
> supervisor_transient_children_fix

Thanks! Will include in pu.

--
Björn Gustavsson, Erlang/OTP, Ericsson AB

________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
uwiger
Posted: Thu Nov 11, 2010 10:50 am Reply with quote
User Joined: 03 Jul 2006 Posts: 604 Location: Sweden
Hmm, interesting... Smile

The documentation for 'supervisor' says:

"...a transient child process should be restarted only if it
terminates abnormally, i.e. with another exit reason than normal."

OTOH, the code has violated* this description at least since R6C-0.

Perhaps the documentation should be changed then?

But what is the principle implemented exactly? The way it currently works,
a child that explicitly exits with reason shutdown (presumably signaling that
it doesn't want to restart), it _will_ be restarted if the supervisor is configured
for 'permanent' supervision of the child, but not if it's 'transient' supervision.

I think this feels wrong and unnecessary, but respect the reluctance to break
important code. Perhaps mnesia could be changed so as not to rely on this
behaviour, and the supervisor module be corrected after that?

So far, the documented principle in Erlang has been that there is exit(normal),
and abnormal exits. The main use of the 'shutdown' convention has been
(in my mind) to differentiate between a clean coordinated shutdown, and one
where the client tried to do something (perhaps important) but failed.

* Strictly speaking, it doesn't violate it, since it doesn't say "if and only if".

BR,
Ulf W

On 9 Nov 2010, at 07:09, Bj
View user's profile Send private message Visit poster's website
Guest
Posted: Thu Nov 11, 2010 11:00 am Reply with quote
Guest
2010/10/29 Björn Gustavsson <bgustavsson@gmail.com>:
> On Fri, Oct 29, 2010 at 1:19 PM, Michal Ptaszek
> <michal.ptaszek@erlang-solutions.com> wrote:
>> Hi,
>>
>> we have found the following inconsistency in the supervisor.erl code:
>> when supervisor's child restart strategy is set to transient and the child exits with reason shutdown, it is never restarted.
>>
>> The patches include fix for the issue and the test suite used for reproducing the error, and later, after patching, for verifying the correctness of the code.
>>
>> The patches are available here:
>> git fetch git@github.com:paulgray/otp.git
>> supervisor_transient_children_fix
>
> Thanks! Will include in pu.

This change breaks mnesia (27 test cases fail).

While it might be possible to update mnesia to
cope with this change, we suspect that other
applications could break as well.

Therefore, the patch has been rejected and
will be taken out of of pu.

--
Björn Gustavsson, Erlang/OTP, Ericsson AB

________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum