I came across the issue while implementing v4, but looking at the code it applies to <v4 as well: When calling Add while the supervisor is in progress of stopping or has already stopped, it will block forever on trying to send to s.control. I couldn't find any specification of the behaviour when calling Add on a stopped supervisor. Even if this wasn't allowed, the deadlock could still happen due to a race between stopping and adding a service. A solution could be to use sendControl and make .Add a noop on a stopped supervisor.
I came across the issue while implementing v4, but looking at the code it applies to <v4 as well: When calling
Add
while the supervisor is in progress of stopping or has already stopped, it will block forever on trying to send tos.control
. I couldn't find any specification of the behaviour when callingAdd
on a stopped supervisor. Even if this wasn't allowed, the deadlock could still happen due to a race between stopping and adding a service. A solution could be to usesendControl
and make.Add
a noop on a stopped supervisor.