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
1
vote
1 answer

Actor supervised by BackoffSupervisor loses stashed messages after restart

I have an actor with stash usage. Sometimes, when it crashes, it loses all stashed messages. I found that it depends on what supervision logic I use. I wrote a simple example. An actor with the stash: case object WrongMessage case object…
Aleksey Isachenkov
  • 1,230
  • 6
  • 16
1
vote
1 answer

Does Akka automatically copy over variables when an actor fails

In Akka Cookbook by Héctor Veiga Ortiz, the reader is told that When an actor throws an exception, it sends a message to the supervisor, and the supervisor handles the failure by restarting that actor. It clears out the accumulated state of the…
Allen Han
  • 1,163
  • 7
  • 16
1
vote
1 answer

Retry on minor Exceptions for a long-living akka actor

I have an actor that is created at application startup as a child of another actor and receives a message once per day from the parent to perform operation to fetch some files from some SFTP server. Now, there might be some minor temporary…
white-hawk-73
  • 856
  • 2
  • 10
  • 24
1
vote
2 answers

Akka - how a parent sends a message to child after child had an exception

Assuming I have a parent actor that sends one message at a time to its child actor. When the child is done processing the current message it notifies the parent that in it turn will send a new message to the child. In order to keep this loop even if…
t-rex-50
  • 201
  • 1
  • 4
  • 10
1
vote
1 answer

Akka: how can I catch failure of one actor inside another (non child) actor?

I have two actors: ProcessManager which handles some processes in the system (for example, user registration, purchase, etc) Notifier - should notify the user if some error occurred in ProcessManager. I need to catch failure of ProcessManager…
Teimuraz
  • 8,795
  • 5
  • 35
  • 62
1
vote
2 answers

What is the correct way to retry http calls from Akka Actors

I have an actor that makes Http call to an external service. At times that services responds with Http 404 and there are also http connection errors at times. Both these goes away when retried again. What is the best way to retry the request by the…
Prem Kumar
  • 15
  • 6
1
vote
1 answer

Akka - what after an actor has been stopped?

I am not sure what approach to follow for Akka supervision. I have an Akka actor that lists files from a FTP server when a message triggers it. If the connection is broken, the actor will fail with an exception (say, IOException) which will trigger…
ticofab
  • 7,551
  • 13
  • 49
  • 90
1
vote
0 answers

Akka: testing supervision strategy with TestProbes

I'm testing an actor which spawns and coordinates child worker actors. In order to do so I've substituted child actor creation with TestProbes which are used to observe and simulate exchanged messages. However I've ran into a problem when trying to…
1
vote
1 answer

Overriding Supervisorstrategy as a val in concrete Actor

The Actor trait in Scala is defined like so, /** * User overridable definition the strategy to use for supervising * child actors. */ def supervisorStrategy: SupervisorStrategy = SupervisorStrategy.defaultStrategy However i see that all example…
Som Bhattacharyya
  • 3,972
  • 35
  • 54
1
vote
2 answers

Resend "init" message on Akka actor restart

I have a child "consumer" actor that connects to some external data stream, parses its messages and forwards them further inside the application. This "producer" system has a pub-sub architecture, but does not restore subscriptions after reconnect.…
fghkngfdx
  • 135
  • 4
1
vote
0 answers

what should be the supervision strategy for AskTimeOutException

I am new to supervision in akka i want to know what supervision strategy is good when we get a ask timeout exception, what is more appropriate Restart or Resume here is the sample code class ActorA extends Actor{ override val supervisorStrategy =…
swaheed
  • 3,671
  • 10
  • 42
  • 103
1
vote
0 answers

How can I supervise an akka-Http HttpApp server?

I have a akka ActorSystem with some features and I use akka-http server (HttpApp) as an endpoint. This http server provide some services to legacy users that are not implemented with akka. I want to supervise this HttpApp server in order to manage…
Ricardo Gasca
  • 1,435
  • 1
  • 9
  • 5
1
vote
1 answer

Akka Actor custom Supervisors

Akka docs say to configure akka.actor.guardian-supervisor-strategy, which takes the fully-qualified class-name of a SupervisorStrategyConfigurator SupervisorStrategyConfigurator is a trait. Do I need to extend any classes with my subclassed…
kliew
  • 3,073
  • 1
  • 14
  • 25
1
vote
2 answers

Sending back to sender, from supervisor, in case of failure

I have an Actor, which acts as a Supervisor, but also needs to "return" data to the caller, wether this is an actor or not shouldn't matter. I am asking my Supervisor, let's call him SV. SV Processes the message I send to him, and sends back a…
Kao
  • 2,242
  • 3
  • 22
  • 31
1
vote
1 answer

Supervisor strategy RESTART, doesn't actually restart my child actors?

I have the below strat: override val supervisorStrategy = OneForOneStrategy(10, 10.seconds) { case e: JedisConnectionException => Restart case e: Exception => Restart } From what I've read(which I think I'm misunderstanding), whenever…
iCodeLikeImDrunk
  • 17,085
  • 35
  • 108
  • 169