From bf78ed8a94a0b81e266a4a56a7f5367952cbd31a Mon Sep 17 00:00:00 2001 From: zbynek001 Date: Thu, 19 Jul 2018 19:57:36 +0200 Subject: [PATCH] confirm TakeOverFromMe when singleton already in oldest state --- .../Akka.Cluster.Tools/Singleton/ClusterSingletonManager.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/contrib/cluster/Akka.Cluster.Tools/Singleton/ClusterSingletonManager.cs b/src/contrib/cluster/Akka.Cluster.Tools/Singleton/ClusterSingletonManager.cs index e79459db1c5..c519b70a88a 100644 --- a/src/contrib/cluster/Akka.Cluster.Tools/Singleton/ClusterSingletonManager.cs +++ b/src/contrib/cluster/Akka.Cluster.Tools/Singleton/ClusterSingletonManager.cs @@ -903,6 +903,12 @@ private void InitializeFSM() { return GoToHandingOver(oldest.Singleton, oldest.SingletonTerminated, Sender); } + else if (e.FsmEvent is TakeOverFromMe) + { + // already oldest, so confirm and continue like that + Sender.Tell(HandOverToMe.Instance); + return Stay(); + } else if (e.FsmEvent is Terminated terminated && e.StateData is OldestData o && terminated.ActorRef.Equals(o.Singleton)) { return Stay().Using(new OldestData(o.Singleton, true));