Quantcast
Channel: User LMeyer - Stack Overflow
Viewing all articles
Browse latest Browse all 48

Answer by LMeyer for How to handle master actor failure

$
0
0

From the docs :

/user: The Guardian Actor

The actor which is probably most interacted with is the parent of all user-created actors, the guardian named "/user". Actors created using system.actorOf() are children of this actor. This means that when this guardian terminates, all normal actors in the system will be shutdown, too. It also means that this guardian’s supervisor strategy determines how the top-level normal actors are supervised. Since Akka 2.1 it is possible to configure this using the setting akka.actor.guardian-supervisor-strategy, which takes the fully-qualified class-name of a SupervisorStrategyConfigurator. When the guardian escalates a failure, the root guardian’s response will be to terminate the guardian, which in effect will shut down the whole actor system.

Your master is the top level actor in your application therefore he is a child of the user guardian, so he'll be restarted automatically because supervision for the Guardian is defaulting to :

  final val defaultDecider: Decider = {    case _: ActorInitializationException ⇒ Stop    case _: ActorKilledException         ⇒ Stop    case _: DeathPactException           ⇒ Stop    case _: Exception                    ⇒ Restart  }

Viewing all articles
Browse latest Browse all 48

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>