InvalidActorNameException even after Terminated received for that name
I am getting
akka.actor.InvalidActorNameException: actor name db.Persist is not unique!
from Akka 2.0.5 sometimes, even though I am waiting for a Termination message for that actor before recreating it. The docs say:
"Since stopping an actor is asynchronous, you cannot immediately reuse the name of the child you just
stopped; this will result in an InvalidActorNameException. Instead, watch the terminating actor and
create its replacement in response to the Terminated message which will eventually arrive."
I am following that advice, and I even check for duplicate Termination messages, but it still doesn't work reliably.
Investigating...
akka.actor.InvalidActorNameException: actor name db.Persist is not unique!
from Akka 2.0.5 sometimes, even though I am waiting for a Termination message for that actor before recreating it. The docs say:
"Since stopping an actor is asynchronous, you cannot immediately reuse the name of the child you just
stopped; this will result in an InvalidActorNameException. Instead, watch the terminating actor and
create its replacement in response to the Terminated message which will eventually arrive."
I am following that advice, and I even check for duplicate Termination messages, but it still doesn't work reliably.
Investigating...
Leave a comment
From my reading of the Akka source code, I guess this happens because my watching actor is not the direct parent of the watched actor.
If it was, I think it would always work, because the system ChildTerminated message would always take precedence over the user Terminated message.
If it was, I think it would always work, because the system ChildTerminated message would always take precedence over the user Terminated message.