refactor(mesh): step 2 — delete the node-side ClusterClient and its centralClient parameter
WithOtOpcUaRuntimeActors no longer builds a ClusterClient from MeshTransport:CentralContactPoints, and NodeCommunicationActor.Props takes only the gRPC IApplyAckSender. The ackRouter gate narrows from `useClusterClient || useGrpc` to `useGrpc`, and the CentralClusterClientName constant is gone. NodeCommunicationActor's no-transport warning now names MeshTransport:CentralGrpcEndpoints and MeshTransport:Mode only — the old text pointed an operator at a key that no longer exists. Ripples in this step: the two ClusterClient-shaped facts in NodeCommunicationActorTests (Send-not-SendToAll, and sender-wins-over-a-client) are deleted — the first has no subject left, the second guarded a both-transports-present state that is now unconstructible. The Runtime ServiceCollectionExtensions fact keeps its ackRouter pin and drops its "no ClusterClient actor exists" half for the same reason.
This commit is contained in:
@@ -127,23 +127,22 @@ public sealed class ServiceCollectionExtensionsTests
|
||||
|
||||
/// <summary>
|
||||
/// Under <c>MeshTransport:Mode = Grpc</c> an ApplyAck produced by the driver host reaches the
|
||||
/// registered <see cref="IApplyAckSender"/>, and no ClusterClient actor exists
|
||||
/// (ClusterClient→gRPC migration Task 1B.2).
|
||||
/// registered <see cref="IApplyAckSender"/>.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This is the fact that pins the <c>ackRouter</c> gate in <c>WithOtOpcUaRuntimeActors</c>
|
||||
/// (<c>useClusterClient || useGrpc ? nodeComm : null</c>). Narrowed back to ClusterClient-only
|
||||
/// that gate still compiles and every unit test still passes, while every ack on a Grpc node
|
||||
/// goes out on the <c>deployment-acks</c> DPS topic instead — where, in the split-mesh topology
|
||||
/// Grpc exists to serve, central is not subscribed. The whole transport would be dead and
|
||||
/// nothing below this level of the stack could tell.
|
||||
/// (<c>useGrpc ? nodeComm : null</c>). Drop the <c>useGrpc</c> arm and that gate still compiles
|
||||
/// and every unit test still passes, while every ack on a Grpc node goes out on the
|
||||
/// <c>deployment-acks</c> DPS topic instead — where, in the split-mesh topology Grpc exists to
|
||||
/// serve, central is not subscribed. The whole transport would be dead and nothing below this
|
||||
/// level of the stack could tell.
|
||||
///
|
||||
/// The dispatch names a deployment that does not exist in the in-memory ConfigDb, so the apply
|
||||
/// fails and the host emits a Failed ack — deterministic, synchronous, and it exercises the
|
||||
/// real <c>SendAck</c> path rather than poking the router directly.
|
||||
/// </remarks>
|
||||
[Fact]
|
||||
public async Task Under_Grpc_a_driver_host_ack_reaches_the_ack_sender_and_no_ClusterClient_exists()
|
||||
public async Task Under_Grpc_a_driver_host_ack_reaches_the_ack_sender()
|
||||
{
|
||||
var sender = new RecordingAckSender();
|
||||
using var host = BuildRuntimeActorHost(services =>
|
||||
@@ -160,7 +159,6 @@ public sealed class ServiceCollectionExtensionsTests
|
||||
await host.StartAsync();
|
||||
try
|
||||
{
|
||||
var system = host.Services.GetRequiredService<ActorSystem>();
|
||||
var driverHost = host.Services.GetRequiredService<IRequiredActor<DriverHostActorKey>>();
|
||||
|
||||
driverHost.ActorRef.Tell(new DispatchDeployment(
|
||||
@@ -168,18 +166,14 @@ public sealed class ServiceCollectionExtensionsTests
|
||||
new RevisionHash("rev-that-does-not-exist"),
|
||||
new CorrelationId(Guid.NewGuid())));
|
||||
|
||||
// The ack travelled DriverHostActor -> NodeCommunicationActor -> IApplyAckSender. Under a
|
||||
// ClusterClient-only gate it would have gone to DPS and this never completes.
|
||||
// The ack travelled DriverHostActor -> NodeCommunicationActor -> IApplyAckSender. With the
|
||||
// useGrpc arm dropped from the ackRouter gate it would have gone to DPS instead and this
|
||||
// never completes.
|
||||
var deadline = DateTime.UtcNow.AddSeconds(15);
|
||||
while (sender.Sent.Count == 0 && DateTime.UtcNow < deadline)
|
||||
await Task.Delay(50);
|
||||
|
||||
sender.Sent.Count.ShouldBe(1);
|
||||
|
||||
// And the Akka cross-mesh association is genuinely gone, not merely unused.
|
||||
await Should.ThrowAsync<ActorNotFoundException>(() => system
|
||||
.ActorSelection($"/user/{ServiceCollectionExtensions.CentralClusterClientName}")
|
||||
.ResolveOne(TimeSpan.FromMilliseconds(500)));
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user