From 9eec062258beab0efb31b1b7666e8cda56701309 Mon Sep 17 00:00:00 2001 From: Aaron Stannard Date: Wed, 10 Jan 2024 12:42:09 -0600 Subject: [PATCH] [Akka.NET v1.5.15 upgrade] introduced `AK1001` bug (#150) * introduced `AK1001` bug * upgraded to Akka.NET v1.5.15 --- src/Directory.Build.props | 6 +++--- .../SqlSharding.Host/Actors/ProductTotalsActor.cs | 12 +++++++++--- .../Sharding/ProductMessageRouter.cs | 4 ---- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 5d3352a..d031b36 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -16,9 +16,9 @@ net6.0 2.4.2 17.6.0 - 1.5.7 - 1.3.1 - 1.5.5 + 1.5.15 + 1.3.2 + 1.5.15 [7.0.0,) diff --git a/src/clustering/sharding-sqlserver/SqlSharding.Host/Actors/ProductTotalsActor.cs b/src/clustering/sharding-sqlserver/SqlSharding.Host/Actors/ProductTotalsActor.cs index f31d0ad..5bd6c28 100644 --- a/src/clustering/sharding-sqlserver/SqlSharding.Host/Actors/ProductTotalsActor.cs +++ b/src/clustering/sharding-sqlserver/SqlSharding.Host/Actors/ProductTotalsActor.cs @@ -49,8 +49,6 @@ public ProductTotalsActor(string persistenceId) var response = State.ProcessCommand(cmd); var sentResponse = false; - var sender = Sender; - if (response.ResponseEvents.Any()) { PersistAll(response.ResponseEvents, productEvent => @@ -66,7 +64,15 @@ public ProductTotalsActor(string persistenceId) if (!sentResponse) // otherwise we'll generate a response-per-event { sentResponse = true; - sender.Tell(response); + + async Task ReplyToSender() + { + await Task.Delay(1); + return response; + } + var sender = Sender; + ReplyToSender().PipeTo(sender, failure: ex => new Status.Failure(ex)); + } if(LastSequenceNr % 10 == 0) diff --git a/src/clustering/sharding-sqlserver/SqlSharding.Shared/Sharding/ProductMessageRouter.cs b/src/clustering/sharding-sqlserver/SqlSharding.Shared/Sharding/ProductMessageRouter.cs index 7edf4ee..e0b0b2d 100644 --- a/src/clustering/sharding-sqlserver/SqlSharding.Shared/Sharding/ProductMessageRouter.cs +++ b/src/clustering/sharding-sqlserver/SqlSharding.Shared/Sharding/ProductMessageRouter.cs @@ -15,10 +15,6 @@ public sealed class ProductMessageRouter : HashCodeMessageExtractor return productId.ProductId; } - // need this for remember-entities - if (message is ShardRegion.StartEntity se) - return se.EntityId; - return null; } } \ No newline at end of file