akkadotnet / akka.net

Canonical actor model implementation for .NET with local + distributed actors in C# and F#.
http://getakka.net
Other
4.72k stars 1.04k forks source link

LocalActorRef.Stop() and Context.Stop(ActorRef) yield different results for child actors #40

Closed Aaronontheweb closed 10 years ago

Aaronontheweb commented 10 years ago

When attempting to stop a child Actor, there are a couple of different methods of doing it.

Calling LocalActorRef.Stop() on the child's ActorRef doesn't end the parent actor's supervision of the child, but Context.Stop(ActorRef) does - need to implement some messaging to tell the parent to stop watching the child regardless of how it died, so long as it was gracefully terminated.

Aaronontheweb commented 10 years ago

Working on this now

rogeralsing commented 10 years ago

We should also have additional tests in the ActorLifecycleSpec to verify consistent behavior for this.

Aaronontheweb commented 10 years ago

So is this issue technically fixed then?

rogeralsing commented 10 years ago

Yes, it turns out that cell.Stop(ref) actually calls ref.Stop which in turn calls cell.Stop() in akka. So we do the same now.

The expected behavior is quite hard to test though, the actor is removed well after the PostStop has been called according to Akka, so I'm not sure how to test this except waiting after stopping an actor. But it is correct now as far as I can tell.