Hi, #1 sender is deadLetters
You are closing over the method this.sender() from the actor where you defined the strategy, so you are not calling sender() in the RouterActor which is what would return the routee actor where the exception happened. #2. All routees restarted http://doc.akka.io/docs/akka/current/scala/routing.html#supervision > the router’s supervisor will treat the error as an error with the router > itself. Therefore a directive to stop or restart will cause the router > *itself* to stop or restart. The router, in turn, will cause its children > to stop and restart. -- Johan Akka Team On Sat, May 6, 2017 at 4:12 PM, Urvi <[email protected]> wrote: > Hello, > > I have a MasterActor where a router is defined and that is where I defined > the following supervisionStrategy: > > override val supervisorStrategy = OneForOneStrategy() { > case _: FileNotFoundException => > println("****** Failed actor in FileNotFound: " + sender) > Restart > } > > I then passed this supervisionStrategy to the router: > > val router = context.actorOf(RemoteRouterConfig(RoundRobinPool(3, > supervisorStrategy=supervisorStrategy), > addresses).props(Props(classOf[MapActor], > reduceActor)), "router") > > I think this part is right, based on the Akka documentation. > > I have 2 issues so far: > > Issue #1: > > I noticed that sender is deadLetters in the print statement. Why is > that? I expected sender to be one of the routees. > > Issue #2: > > I put a print statement in the postRestart method and I see that only one > routee is restarted when a FileNotFound exception is encountered and the > processing of the continues. That seems like the correct behavior > > If I change the supervisorStrategy to Stop (shown below), I see that ALL > actors stop and I do not ANY processing taking place, at all. I expected > to see processing occur by all actors. When the failed actor hits the > FileNotFound exception, I thought that ONLY that actor should be stopped > and the others should continue processing. > > override val supervisorStrategy = OneForOneStrategy() { > case _: FileNotFoundException => > println("****** Failed actor in FileNotFound: " + sender) > Stop > } > > Given the above observations, I am afraid I have not set this up > properly. Thanks in advance > > -- > >>>>>>>>>> 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 https://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. -- >>>>>>>>>> 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 https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
