Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Possible incorrect documentation for the default supervisor strategy #3251

Closed
stijnherreman opened this issue Jan 5, 2018 · 1 comment
Closed

Comments

@stijnherreman
Copy link

stijnherreman commented Jan 5, 2018

http://getakka.net/articles/actors/fault-tolerance.html#default-supervisor-strategy says:

Escalate is used if the defined strategy doesn't cover the exception that was thrown.

When the supervisor strategy is not defined for an actor the following exceptions are handled by default:

  • ActorInitializationException will stop the failing child actor
  • ActorKilledException will stop the failing child actor
  • Exception will restart the failing child actor
  • Other types of Exception will be escalated to parent actor

The implementation doesn't match this behaviour:

public static IDecider DefaultDecider = Akka.Actor.Decider.From(Directive.Restart,
Directive.Stop.When<ActorInitializationException>(),
Directive.Stop.When<ActorKilledException>(),
Directive.Stop.When<DeathPactException>());

https://doc.akka.io/docs/akka/current/fault-tolerance.html#default-supervisor-strategy says:

Escalate is used if the defined strategy doesn’t cover the exception that was thrown.

When the supervisor strategy is not defined for an actor the following exceptions are handled by default:

  • ActorInitializationException will stop the failing child actor
  • ActorKilledException will stop the failing child actor
  • DeathPactException will stop the failing child actor
  • Exception will restart the failing child actor
  • Other types of Throwable will be escalated to parent actor

It's important to note here that there is no similar class for Throwable in .NET, that is, a base class for Exception.

I also found that at one point, akka did escalate Throwable but it was removed, so possibly their docs are out-of-date as well. See akka/akka@f054474#diff-c831999efea2141bffe949611799a66b for the relevant commit removing it.
The default in akka is to restart on Exception and escalate on other types of Throwable. See https://gitter.im/akka/akka?at=5a4f8140ce68c3bc7480943c

Relevant gitter discussions:

@marcpiechura
Copy link
Contributor

Since we don’t have Throwable in .Net in Akka.net the strategy is Restart by default, so yes the docs are a bit misleading and it was fixed in #3308 therefore closing this one.

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

No branches or pull requests

2 participants