From 5d7ecdf73744109aed10c6b2ad485e42f2eb9f18 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Thu, 6 Aug 2026 15:41:25 -0400 Subject: [PATCH] =?UTF-8?q?refactor(mesh):=20step=203=20=E2=80=94=20delete?= =?UTF-8?q?=20both=20ClusterClientReceptionist=20registrations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Central's CentralCommunicationActor and a node's NodeCommunicationActor no longer register with a receptionist; the ActorRegistry entry each already carried is now the whole reachability story, and it is what CentralCommandGrpcService / NodeCommandGrpcService resolve to hand an inbound message over. Both `using Akka.Cluster.Tools.Client` directives are gone with them. --- .../ServiceCollectionExtensions.cs | 9 +++------ .../ServiceCollectionExtensions.cs | 9 +++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.ControlPlane/ServiceCollectionExtensions.cs b/src/Server/ZB.MOM.WW.OtOpcUa.ControlPlane/ServiceCollectionExtensions.cs index 472f753e..5a42f356 100644 --- a/src/Server/ZB.MOM.WW.OtOpcUa.ControlPlane/ServiceCollectionExtensions.cs +++ b/src/Server/ZB.MOM.WW.OtOpcUa.ControlPlane/ServiceCollectionExtensions.cs @@ -1,6 +1,5 @@ using Akka.Actor; using Akka.Cluster.Hosting; -using Akka.Cluster.Tools.Client; using Akka.Hosting; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; @@ -94,11 +93,9 @@ public static class ServiceCollectionExtensions () => serviceProvider.GetService()), MeshPaths.CentralCommunicationName); - // Registered unconditionally, in both transport modes. Under Dps nothing dials it, and - // an idle registration costs nothing — whereas registering only under ClusterClient - // would mean flipping the flag on a running fleet requires a central restart before any - // node can ack, turning a config change back into a deployment. - ClusterClientReceptionist.Get(system).RegisterService(actor); + // The registry entry is the whole reachability story: CentralCommandGrpcService resolves + // this key to hand an inbound ack over. Nothing registers with a receptionist any more — + // there is no Akka association between central and a site mesh to register into. registry.Register(actor); }); diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.Runtime/ServiceCollectionExtensions.cs b/src/Server/ZB.MOM.WW.OtOpcUa.Runtime/ServiceCollectionExtensions.cs index 01b1a23b..3ce81372 100644 --- a/src/Server/ZB.MOM.WW.OtOpcUa.Runtime/ServiceCollectionExtensions.cs +++ b/src/Server/ZB.MOM.WW.OtOpcUa.Runtime/ServiceCollectionExtensions.cs @@ -1,6 +1,4 @@ -using System.Collections.Immutable; using Akka.Actor; -using Akka.Cluster.Tools.Client; using Akka.Event; using Akka.Hosting; using Microsoft.EntityFrameworkCore; @@ -433,10 +431,9 @@ public static class ServiceCollectionExtensions NodeCommunicationActor.Props(ackSender), MeshPaths.NodeCommunicationName); - // Registered with the receptionist in ALL modes: under Dps and Grpc nothing dials it, and - // an idle registration costs nothing — whereas registering only under ClusterClient would - // make flipping the flag require a node restart before central could reach it. - ClusterClientReceptionist.Get(system).RegisterService(nodeComm); + // The registry entry is the whole reachability story: NodeCommandGrpcService resolves + // this key to hand an inbound command over. Nothing registers with a receptionist any + // more — there is no Akka association from central into this mesh to register into. registry.Register(nodeComm); // Continuous-historization recorder — gated on ContinuousHistorization:Enabled AND the