Hi Brian,
It seems to me that it is not the stopping that doesn’t work - you can
verify this by putting an override def postStop() = log.info("context.stop
really worked") into the worker actor.

What seems to be happening is the remote watch fails to be established in
time, which is part of the remoting. And it fails simply because you stop
your actor “right away”, then the system message arrives, and tries to
locate the (now already gone) actor.
It doesn’t find it so the selection fails (resolve of path sequence …
failed). Thus the remote-deathwatch is not registered on the remote actor,
because it’s “dead on arrival”.
In essence, it is a race between the system message (establishing the
remote watch - so you can get notified that the actor has died on the
allocator actor) getting to the remote worker actor and it already being
dead.

It should not impact the proper functioning of the deathwatch however.

The AssociationError looks like you’ve shut down the other actor system,
and it told this one that it is shutting down - therefore the association
gets closed as well.
It seems to have been a clean shutdown (shutting down the actor system),
since then it notifies all its connections that it will be shutting down.
Can you confirm that that was what was going on with these nodes?

Hope this helps!

—
Konrad Malawski

On Mon, Jan 12, 2015 at 11:47 AM, Brian Fowler <brian.w.fow...@gmail.com>
wrote:

Hi,
>
> Can anyone help with the following in Akka 2.3.8
>
> The actor
>
> class SquarerActor extends Actor with ActorLogging {
>   override def receive = {
>     case SquareTask(id, number, _) => {
>       log.info(s"${Thread.currentThread()} ${id}: ${number}^2 = 
> ${number*number} for ${sender}")
>       context.stop(self)
>     }
>     case _ => {
>       log.info(s"unknown message received")
>     }
>   }
>
> }
>
> when created locally from
>
> class TaskAllocatorActor extends Actor with ActorLogging {
>   override def receive = {
>     case task: SquareTask => {
>       log.info(s"${Thread.currentThread()} received ${task} from ${sender}")
>
>       context.actorOf(Props[SquarerActor],task.id) ! task
>     }
>     case _ => {
>       println("Unknown Task")
>     }
>   }
> }
>
>
> works, but when deployed remotely using
>
>
> class TaskAllocatorActor extends Actor with ActorLogging {
>   override def receive = {
>     case task: SquareTask => {
>       log.info(s"${Thread.currentThread()} received ${task} from ${sender}")
>
>
>       val actorRef = context.actorOf(Props[SquarerActor]
>         .withDeploy(Deploy(scope = 
> RemoteScope(AddressFromURIString("akka.tcp://Example2BoxTwo@127.0.0.1:2553")))),
>  task.id)
>       actorRef ! task
>     }
>     case _ => {
>       println("Unknown Task")
>     }
>   }
> }
>
>
> the SquarerActor context.stop(self) fails, on the remote system the log is 
> below, note that the remote actor receives the message and executes the 
> receive block but the context.stop(self) fails
>
>
> [2015-01-12 10:33:47,735] [DEBUG] 
> LocalActorRefProvider(akka://Example2BoxTwo) - Received command 
> [DaemonMsgCreate(Props(Deploy(,Config(SimpleConfigObject({})),NoRouter,RemoteScope(akka.tcp://Example2BoxTwo@127.0.0.1:2553),,),class
>  
> SquarerActor,Vector()),Deploy(,Config(SimpleConfigObject({})),NoRouter,RemoteScope(akka.tcp://Example2BoxTwo@127.0.0.1:2553),,),akka.tcp://Example2BoxTwo@127.0.0.1:2553/remote/akka.tcp/Example1OneBoxOneTaskAllocatorActor@127.0.0.1:2552/user/taskAllocatorActor/5#562890728,Actor[akka.tcp://Example1OneBoxOneTaskAllocatorActor@127.0.0.1:2552/user/taskAllocatorActor#1735676205]
>  
> <http://Example2BoxTwo@127.0.0.1:2553/remote/akka.tcp/Example1OneBoxOneTaskAllocatorActor@127.0.0.1:2552/user/taskAllocatorActor/5#562890728,Actor[akka.tcp://Example1OneBoxOneTaskAllocatorActor@127.0.0.1:2552/user/taskAllocatorActor%231735676205]>)]
>  to RemoteSystemDaemon on [akka://Example2BoxTwo]
>
> [2015-01-12 10:33:47,747] [INFO] SquarerActor - 
> Thread[Example2BoxTwo-akka.actor.default-dispatcher-21,5,main] 5: 5^2 = 25 
> for 
> Actor[akka.tcp://Example1OneBoxOneTaskAllocatorActor@127.0.0.1:2552/user/taskAllocatorActor#1735676205]
>
>  [2015-01-12 10:33:47,760] [DEBUG] 
> LocalActorRefProvider(akka://Example2BoxTwo) - resolve of path sequence 
> [/remote/akka.tcp/Example1OneBoxOneTaskAllocatorActor@127.0.0.1:2552/user/taskAllocatorActor/5#562890728]
>  failed
>
> [2015-01-12 10:33:47,792] [WARN] LocalActorRefProvider(akka://Example2BoxTwo) 
> - Unknown message 
> [DeathWatchNotification(Actor[akka.tcp://Example1OneBoxOneTaskAllocatorActor@127.0.0.1:2552/user/taskAllocatorActor#1735676205],true,false)]
>  received by [Actor[akka://Example2BoxTwo/remote]]
>
> [2015-01-12 10:33:47,820] [ERROR] akka.remote.EndpointWriter - 
> AssociationError [akka.tcp://Example2BoxTwo@127.0.0.1:2553] <- 
> [akka.tcp://Example1OneBoxOneTaskAllocatorActor@127.0.0.1:2552]: Error [Shut 
> down address: akka.tcp://Example1OneBoxOneTaskAllocatorActor@127.0.0.1:2552] 
> [ akka.remote.ShutDownAssociation: Shut down address: 
> akka.tcp://Example1OneBoxOneTaskAllocatorActor@127.0.0.1:2552 Caused by: 
> akka.remote.transport.Transport$InvalidAssociationException: The remote 
> system terminated the association because it is shutting down. ]
>
> [2015-01-12 10:33:47,820] [ERROR] akka.remote.EndpointWriter - 
> AssociationError [akka.tcp://Example2BoxTwo@127.0.0.1:2553] <- 
> [akka.tcp://Example1OneBoxOneTaskAllocatorActor@127.0.0.1:2552]: Error [Shut 
> down address: akka.tcp://Example1OneBoxOneTaskAllocatorActor@127.0.0.1:2552] 
> [ akka.remote.ShutDownAssociation: Shut down address: 
> akka.tcp://Example1OneBoxOneTaskAllocatorActor@127.0.0.1:2552 Caused by: 
> akka.remote.transport.Transport$InvalidAssociationException: The remote 
> system terminated the association because it is shutting down. ]
>
>
> Using  self ! PoisonPill also fails in the same way
>
>
> Thanks,
>
>
> Brian
>
>  --
> >>>>>>>>>> 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 akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>
​
-- 
Akka Team
Typesafe - The software stack for applications that scale
Blog: letitcrash.com
Twitter: @akkateam

-- 
>>>>>>>>>>      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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to