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

Do not use expression based options for backoff props #6805

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/core/Akka/Pattern/BackoffOnRestartSupervisor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ internal sealed class BackoffOnRestartSupervisor : BackoffSupervisorBase
private readonly OneForOneStrategy _strategy;
private readonly ILoggingAdapter _log = Context.GetLogger();

/// <devremarks>
/// If the arguments here change, you -must- change the invocation in <see cref="BackoffOptions"/> accordingly!
/// Expression based props are too slow for many scenarios, so we must drop compile time safety for that sake.
/// </devremarks>
public BackoffOnRestartSupervisor(
Props childProps,
string childName,
Expand Down
4 changes: 2 additions & 2 deletions src/core/Akka/Pattern/BackoffOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,9 @@ internal override Props Props
switch (_backoffType)
{
case RestartImpliesFailure _:
return Props.Create(() => new BackoffOnRestartSupervisor(_childProps, _childName, _minBackoff, _maxBackoff, _reset, _randomFactor, _strategy, _replyWhileStopped, _finalStopMessage));
return Props.Create<BackoffOnRestartSupervisor>(_childProps, _childName, _minBackoff, _maxBackoff, _reset, _randomFactor, _strategy, _replyWhileStopped, _finalStopMessage);
case StopImpliesFailure _:
return Props.Create(() => new BackoffSupervisor(_childProps, _childName, _minBackoff, _maxBackoff, _reset, _randomFactor, _strategy, _replyWhileStopped, _finalStopMessage));
return Props.Create<BackoffSupervisor>(_childProps, _childName, _minBackoff, _maxBackoff, _reset, _randomFactor, _strategy, _replyWhileStopped, _finalStopMessage);
default:
return Props.Empty;
}
Expand Down
4 changes: 4 additions & 0 deletions src/core/Akka/Pattern/BackoffSupervisor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ public BackoffSupervisor(
{
}

/// <summary>
/// If the arguments here change, you -must- change the invocation in <see cref="BackoffOptions"/> accordingly!
/// Expression based props are too slow for many scenarios, so we must drop compile time safety for that sake.
/// </summary>
public BackoffSupervisor(
Props childProps,
string childName,
Expand Down