Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Request: Supervision Strategies / Agent Restart Behaviors #29

Open
daveman1010221 opened this issue Jul 7, 2023 · 1 comment
Open

Comments

@daveman1010221
Copy link

It's possible I've missed this, but I haven't been able to figure out how a supervised actor (one that is spawned by another) might be restarted, in the event of a failure case.

@LeonHartley
Copy link
Owner

Hi @daveman1010221

There are currently only 2 ways actors will be restarted/re-attempted to be started automatically in the event of a failure:

  • Sharded actors will be automatically restarted on a healthy node, in the event of a shard or node failure
  • Persistent actors that are failing to recover can be configured to keep re-trying, by using the Retry failure policy.

For cases not covered, I think it's difficult to define what is an "actor failure", which is easy with runtimes like Akka/Akka.NET since exceptions exist, and can be caught.

When an actor that was spawned by a parent actor stops, a notification is sent to the supervising actor, for which the handling can be overridden via the on_child_stopped function - inside there you could implement custom logic to re-start any actors that were stopped.

Cheers,
Leon

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants