Here you create a top level actor (system.actorOf) and for them it is not guaranteed that the name is free to reuse when you receive the Terminated message, because you don't receive it in the supervisor of the terminated actor.
When you use your own parent actor this is not a problem. /Patrik On Fri, Apr 24, 2015 at 10:34 AM, Anders Båtstrand <[email protected]> wrote: > Reading http://doc.akka.io/docs/akka/snapshot/general/addressing.html, > "Reusing Actor Paths", I would agree with you: > > It may be the right thing to do in very specific circumstances, but make > sure > to confine the handling of this precisely to the actor’s supervisor, > because > that is the only actor which can reliably detect proper deregistration of > the > name, before which creation of the new child will fail. > > I have, however, observed the same as you, and have stopped using readable > names for my actors... :-( > > I am also eager for a clarification! > > Best regards, > > Anders Båtstrand > > > torsdag 23. april 2015 18.54.02 UTC+2 skrev Dragisa Krsmanovic følgende: >> >> I have a test that does something like this: >> >> "test" in { >> val actorName: String = UUID.randomUUID.toString >> val eventActor = system.actorOf(Props(new EventActor(...)), name = >> actorName) >> >> watch(eventActor) // receive message if actor terminates >> >> // do something >> >> system.stop(eventActor) >> >> // wait for actor to properly terminate >> expectTerminated(eventActor, waitTime) >> >> // On slow test server: >> // akka.actor.InvalidActorNameException: actor name >> [d7bd90a2-4518-4012-9ba4-409b5010c2c5] is not unique! >> val eventActor2 = system.actorOf(Props(new EventActor(...)), name = >> actorName) >> >> } >> >> >> Intermittently, I get InvalidActorNameException in the last line when I >> try to create actor the second time. Isn't expectTerminated supposed to >> guarantee that actor name is available again ? >> >> >> Thanks, >> Dragisa >> >> -- > >>>>>>>>>> Read the docs: http://akka.io/docs/ > >>>>>>>>>> Check the FAQ: > http://doc.akka.io/docs/akka/current/additional/faq.html > >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user > --- > You received this message because you are subscribed to the Google Groups > "Akka User List" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. > -- Patrik Nordwall Typesafe <http://typesafe.com/> - Reactive apps on the JVM Twitter: @patriknw -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
