[erlang-bugs] Supervisor terminate_child race

Siri Hansen <>
Wed May 15 15:54:54 CEST 2013


Then again... it is up to the child's start function to create the link,
and from the supervisor's point of view, the only place to add the monitor
would be when the start function returns - which would be just another
place to get a race :(


2013/5/15 Tim Watson <>

> On 15 May 2013, at 11:17, Robert Virding wrote:
>
> Do you mean only using monitors in the supervisor, and no links? If so
> that would not work as you would then not get an exit signal automatically
> sent to the child when the supervisor dies.
>
> Which you do want. Or have I misunderstood you?
>
>
> Oh gosh, how embarrasing. I was thinking in terms of Uni-directional
> Links (viz A Unified Semantics for Future Erlang, Svensson et al), and
> linking child to parent (so as to propagate supervisor exits) but not the
> other way around. Of course we can't do that - just ignore this suggestion.
> [note: I've been implementing the supervisor API for cloud haskell in my
> spare time and got confused between those semantics (viz
> http://haskell-distributed.github.io/static/semantics.pdf) and what I do
> for a day job in the *real world*].
>
> But switching all the supervisor's signal handling to rely on monitor
> notifications rather than trapped exits (which might be ignored) sounds
> good to me. The use of linking would be there to guarantee supervisor death
> is propagated correctly, but we could switch away from handling child
> 'EXIT' signals to handling 'DOWN' notifications instead. This would IMO be
> a bit cleaner.
>
> Cheers,
> Tim
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20130515/97d8af03/attachment.html>


More information about the erlang-bugs mailing list