Questions tagged [akka-supervision]

In Akka supervision describes a dependency relationship between actors: the supervisor delegates tasks to subordinates and therefore must respond to their failures. When a subordinate detects a failure (i.e. throws an exception), it suspends itself and all its subordinates and sends a message to its supervisor, signaling failure.

104 questions
12
votes
1 answer

Is it possible/advisable to have a different supervision strategy for different children of an Akka 2 actor?

I'm playing with Akka and I have a design in which a supervisor actor has a child playing role A and several children playing role B. I want to define a supervision policy such as A failures are escalated (terminating the supervisor) and B ones…
sortega
  • 1,128
  • 9
  • 15
11
votes
1 answer

Is an ActorRef updated when the associated Actor is restarted by the supervisor?

If I create an logging actor like so val logger: ActorRef = actorSystem.actorOf(Props(new Logger())) and the logger restarts due to an Exception, my logger stops writing to disk. I had been sending messages logger ! msg Am I correct in assuming…
kliew
  • 3,073
  • 1
  • 14
  • 25
11
votes
1 answer

Akka Java fault tolerance and actor restarting

I'm currently looking into Fault Tolerance and Supervisor strategies in Akka (Java version). at ... http://doc.akka.io/docs/akka/2.3.2/java/fault-tolerance.html and http://doc.akka.io/docs/akka/2.3.2/general/supervision.html#supervision A few…
HiChews123
  • 1,598
  • 4
  • 20
  • 39
10
votes
2 answers

Akka: How to schedule retries on failure with growing delay intervals?

What is a good way of having an actor try something again on failure, but with growing time intervals between the retries? Let's say I want the actor to try again after 15 seconds, then 30 seconds, then every minute for a limited number of…
Robert Petermeier
  • 4,122
  • 4
  • 29
  • 37
9
votes
2 answers

Distributed Actors in Akka

I'm fairly new to Akka and new to distributed programming in general. Using Akka's Mist component, I've created supervised actors to handle HTTP requests asynchronously. Everything is currently running on one physical machine with local actors. …
Jeffrey Chung
  • 19,319
  • 8
  • 34
  • 54
9
votes
2 answers

How to handle exception with ask pattern and supervision

How should I handle an exception thrown by the DbActor here ? I'm not sure how to handle it, should pipe the Failure case ? class RestActor extends Actor with ActorLogging { import context.dispatcher val dbActor =…
graph1ZzLle
  • 259
  • 2
  • 9
8
votes
1 answer

In AKKA does calling shutdown on a supervisor stop all the actors it's supervising?

Let's say I have a supervisor that has linked 2 actors. When my app shutsdown I want to shutdown those actors gracefully. Does calling supervisor.shutdown() stop all the actors or do I still need to stop my actors manually? gracias
James
  • 15,085
  • 25
  • 83
  • 120
7
votes
1 answer

Akka - how to tell the system what to do after the strategy's max retries reached?

Assuming the supervisor actor defined a certain strategy: private static SupervisorStrategy strategy = new OneForOneStrategy(10, Duration.create("1 minute"), DeciderBuilder. match(Exception.class, e -> resume()). …
t-rex-50
  • 201
  • 1
  • 4
  • 10
6
votes
1 answer

How to supervise cluster singleton in Akka?

I'm trying to supervise an Akka Actor, more specifically a Cluster Singleton created using ClusterSingletonManager. I'm trying to achieve more control over exceptions, logs and Actor's life cycle. Unfortunately, after implementing a solution, I made…
gustavo-vm
  • 131
  • 2
  • 10
6
votes
1 answer

Can a supervision strategy handle a ConnectException?

If a remote actor is not available due to power loss Can the supervision strategy handle the situation? I have coded the example and I have shut down the remote actor system but it seems that the supervision strategy only takes into account…
juanpavergara
  • 1,511
  • 1
  • 11
  • 22
5
votes
2 answers

How to retry failed Unmarshalling of a stream of akka-http requests?

I know it's possible to restart an akka-stream on error with a supervision strategy on the ActorMaterialzer val decider: Supervision.Decider = { case _: ArithmeticException => Supervision.Resume case _ =>…
Guillaume Massé
  • 8,004
  • 8
  • 44
  • 57
5
votes
1 answer

Akka supervisor actor do not handle exception when child actor throws an exception within onFailure of a future

I'm facing a problem with an Akka supervisor actor. When the child actor throws an exception within onFailure method of a future result, the supervisor does not handle the error (I want to restart the child in the case of a ConnectException). I'm…
Gabriel Volpe
  • 101
  • 1
  • 8
4
votes
1 answer

Akka Supervisor Strategy - Correct Use Case

I have been using Akka Supervisor Strategy to handle business logic exceptions. Reading one of the most famous Scala blog series Neophyte, I found him giving a different purpose for what I have always been doing. Example: Let's say I have an…
Thiago Pereira
  • 1,724
  • 1
  • 17
  • 31
4
votes
1 answer

Custom SupervisorStrategy for Akka System Guardian

According to the Akka docs on the System Guardian, if a top-level actor throws an Exception, it will be restarted indefinitely (with 2 exceptions - no pun intended). My actor system has 1 and only 1 top-level actor: Initializer. If Initializer…
smeeb
  • 27,777
  • 57
  • 250
  • 447
4
votes
2 answers

Akka supervisor catch future Failure

I'm trying to develop an application using Futures and Akka supervisors but when A future returns a Failure to an actor its supervisor is not getting the exception. Here's my code. 1) Supervisor actor class TransaccionActorSupervisor() extends…
Rodrigo Cifuentes Gómez
  • 1,304
  • 2
  • 13
  • 28
1
2 3 4 5 6 7