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

Akka.Cluster.Sharding: harden event-sourced RememberEntities infrastructure against transient Akka.Persistence failures #7401

Merged
merged 3 commits into from
Dec 2, 2024

Conversation

Aaronontheweb
Copy link
Member

@Aaronontheweb Aaronontheweb commented Dec 2, 2024

Changes

resolved #7399

Checklist

For significant changes, please ensure that the following have been completed (delete if not relevant):

close akkadotnet#7399 - wrapped the RememberEntities coordinator and shard-store inside
@Aaronontheweb Aaronontheweb changed the title [WIP] Added reproduction for #7399 Akka.Cluster.Sharding: harden event-sourced RememberEntities infrastructure against transient Akka.Persistence failures Dec 2, 2024
Copy link
Member Author

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed my changes

@@ -29,7 +30,15 @@ public EventSourcedRememberEntitiesProvider(string typeName, ClusterShardingSett
/// <returns></returns>
public Props ShardStoreProps(string shardId)
{
return EventSourcedRememberEntitiesShardStore.Props(TypeName, shardId, Settings);
var backoffOptions = Backoff.OnStop(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wraps the ShardStore inside a BackoffSupervisor - uses the same tuning parameters as the shard itself.

@@ -39,7 +48,14 @@ public Props ShardStoreProps(string shardId)
/// <returns></returns>
public Props CoordinatorStoreProps()
{
return EventSourcedRememberEntitiesCoordinatorStore.Props(TypeName, Settings);
var backoffOptions = Backoff.OnStop(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wraps the RememberEntitiesCoordinator inside a BackoffSupervisor - uses the same tuning parameters as the ShardingCoordinator for backoff.

@@ -93,7 +93,7 @@ public RememberEntityStarter(
Timers.StartPeriodicTimer("retry", ResendUnAcked.Instance, settings.TuningParameters.RetryInterval);
}

public ITimerScheduler Timers { get; set; }
public ITimerScheduler Timers { get; set; } = null!;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed a nullability warning here. This value always gets set by the Akka.NET infrastructure.

Copy link
Contributor

@Arkatufus Arkatufus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Arkatufus Arkatufus merged commit 1a22e39 into akkadotnet:dev Dec 2, 2024
12 checks passed
@Aaronontheweb Aaronontheweb deleted the reproduce-7399 branch December 2, 2024 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants