celluloid/celluloid — pull request #318 by Burgestrand (2013-08-23 09:07:49+00:00)
Title: Fix supervision groups not cleaning registry on terminate

I believe the following scenario is what is intended:

- SupervisionGroups link to their members.
- When a member exits, #restart_actor is called with the reason.
- If #restart_actor is given no reason, it will assume a clean shutdown and do nothing.

Unfortunately, I believe that when we terminate a SupervisionGroup, it will terminate all its members in its’ finalizer, and then immediately exit before it is able to receive #restart_actor(actor, empty_reason), and thus the registry won’t be cleared.

I believe my pull request is probably the easiest solution, but not one of the better ones because it feals brittle.

Perhaps the registry would do good to link to its members in a similar fashion to how the SupervisionGroup does? After all, the Registry is kind of similar to a SupervisionGroup; except it does not ensure actors are alive, but allows retrieval of actors by name. That’s a bigger change and not in scope for this pull request, however. Just a thought. :)