feat: preserve grpc write admission and uncertain outcomes
This commit is contained in:
@@ -6,6 +6,8 @@ using ZB.MOM.WW.OtOpcUa.Commons.Observability;
|
||||
using ZB.MOM.WW.OtOpcUa.Commons.OpcUa;
|
||||
using ZB.MOM.WW.OtOpcUa.Commons.Types;
|
||||
using ZB.MOM.WW.OtOpcUa.Core.Abstractions;
|
||||
using ZB.MOM.WW.OtOpcUa.Core.Abstractions.DataConnections;
|
||||
using ZB.MOM.WW.OtOpcUa.Runtime.DataConnections;
|
||||
|
||||
namespace ZB.MOM.WW.OtOpcUa.Runtime.Drivers;
|
||||
|
||||
@@ -71,6 +73,7 @@ public sealed class DriverInstanceActor : ReceiveActor, IWithTimers
|
||||
/// when the host's Ask fires (lmxopcua#777).</param>
|
||||
public sealed record WriteAttribute(string TagId, object Value, long? IssuedAt = null);
|
||||
public sealed record WriteAttributeResult(bool Success, string? Reason);
|
||||
internal sealed record WriteAttributeWithOutcome(WriteAdmissionTicket Ticket, WriteClaim Claim);
|
||||
/// <summary>
|
||||
/// Sent by <see cref="DriverHostActor"/> when an OPC UA client Acknowledges a NATIVE Part 9
|
||||
/// condition (resolved from the condition NodeId to this driver via the host's alarm inverse map).
|
||||
@@ -307,7 +310,13 @@ public sealed class DriverInstanceActor : ReceiveActor, IWithTimers
|
||||
/// <summary>Writes waiting for a slot (or for their tag), in arrival order, stamped with arrival time.
|
||||
/// Failed fast on every exit from <c>Connected</c>, so a queued write never reaches a driver that is
|
||||
/// reconnecting; failed <c>BadTimeout</c> once older than <see cref="_queuedWriteBudget"/> since issued.</summary>
|
||||
private readonly LinkedList<(WriteAttribute Write, IActorRef ReplyTo, long IssuedAt)> _pendingWrites = new();
|
||||
private readonly LinkedList<(WriteAttribute Write, IActorRef ReplyTo, long IssuedAt, long Sequence)> _pendingWrites = new();
|
||||
private readonly LinkedList<(WriteAttributeWithOutcome Write, IActorRef ReplyTo, long Sequence)> _pendingRichWrites = new();
|
||||
private long _queuedWriteSequence;
|
||||
private readonly IWriteDispatchGate? _writeDispatchGate;
|
||||
private readonly LateWriteObserver? _lateWriteObserver;
|
||||
private readonly WriteRouteState? _writeRouteState;
|
||||
private string? _writeIncarnation;
|
||||
|
||||
/// <summary>Tags with a write currently inside the driver. A second write to the same tag waits in the
|
||||
/// queue behind it — two concurrent writes v1, v2 to one tag could otherwise land as v1.</summary>
|
||||
@@ -517,6 +526,23 @@ public sealed class DriverInstanceActor : ReceiveActor, IWithTimers
|
||||
writeTimeout,
|
||||
writeClock, sourcePublisher, sourceIncarnation));
|
||||
|
||||
internal static Props PropsForRichWrites(IDriver driver, IDriverCapabilityInvoker? invoker = null,
|
||||
TimeSpan? commsLossTimeout = null, int? maxWritesInFlight = null, TimeSpan? writeTimeout = null,
|
||||
IWriteDispatchGate? writeDispatchGate = null, LateWriteObserver? lateWriteObserver = null,
|
||||
WriteRouteState? writeRouteState = null, TimeProvider? writeClock = null,
|
||||
IDriverHealthPublisher? healthPublisher = null, string? clusterId = null, TimeSpan? shutdownTimeout = null,
|
||||
SourceSamplePublisher? sourcePublisher = null, long? sourceIncarnation = null, bool startStubbed = false) =>
|
||||
Akka.Actor.Props.CreateBy(new RichWriteActorProducer(() => new DriverInstanceActor(driver, DefaultReconnectInterval, startStubbed, healthPublisher, clusterId,
|
||||
invoker, null, commsLossTimeout, shutdownTimeout, maxWritesInFlight, null, null, writeTimeout, writeClock,
|
||||
sourcePublisher, sourceIncarnation, writeDispatchGate, lateWriteObserver, writeRouteState)));
|
||||
|
||||
private sealed class RichWriteActorProducer(Func<DriverInstanceActor> create) : IIndirectActorProducer
|
||||
{
|
||||
public Type ActorType => typeof(DriverInstanceActor);
|
||||
public ActorBase Produce() => create();
|
||||
public void Release(ActorBase actor) { }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true when the driver should boot in DEV-STUB mode based on host platform and
|
||||
/// configured roles. Only the legacy v1 in-process <c>"Galaxy"</c> type stays Windows-only:
|
||||
@@ -580,7 +606,21 @@ public sealed class DriverInstanceActor : ReceiveActor, IWithTimers
|
||||
TimeProvider? writeClock = null,
|
||||
ZB.MOM.WW.OtOpcUa.Runtime.DataConnections.SourceSamplePublisher? sourcePublisher = null,
|
||||
long? sourceIncarnation = null)
|
||||
: this(driver, reconnectInterval, startStubbed, healthPublisher, clusterId, invoker, healthPollInterval,
|
||||
commsLossTimeout, shutdownTimeout, maxWritesInFlight, queuedWriteBudget, initializeTimeout,
|
||||
writeTimeout, writeClock, sourcePublisher, sourceIncarnation, null, null, null) { }
|
||||
|
||||
private DriverInstanceActor(IDriver driver, TimeSpan reconnectInterval, bool startStubbed,
|
||||
IDriverHealthPublisher? healthPublisher, string? clusterId, IDriverCapabilityInvoker? invoker,
|
||||
TimeSpan? healthPollInterval, TimeSpan? commsLossTimeout, TimeSpan? shutdownTimeout,
|
||||
int? maxWritesInFlight, TimeSpan? queuedWriteBudget, TimeSpan? initializeTimeout,
|
||||
TimeSpan? writeTimeout, TimeProvider? writeClock, SourceSamplePublisher? sourcePublisher,
|
||||
long? sourceIncarnation, IWriteDispatchGate? writeDispatchGate, LateWriteObserver? lateWriteObserver,
|
||||
WriteRouteState? writeRouteState)
|
||||
{
|
||||
_writeDispatchGate = writeDispatchGate;
|
||||
_lateWriteObserver = lateWriteObserver;
|
||||
_writeRouteState = writeRouteState;
|
||||
_sourcePublisher = sourcePublisher;
|
||||
_sourceIncarnation = sourceIncarnation;
|
||||
_writeTimeout = writeTimeout is { } wt && wt > TimeSpan.Zero ? wt : DefaultWriteTimeout;
|
||||
@@ -618,6 +658,7 @@ public sealed class DriverInstanceActor : ReceiveActor, IWithTimers
|
||||
/// <inheritdoc />
|
||||
protected override void PreStart()
|
||||
{
|
||||
if (_writeRouteState is not null) _writeIncarnation = _writeRouteState.BeginDriverIncarnation(_driverInstanceId);
|
||||
if (_sourcePublisher is not null && _sourceIncarnation is { } previous &&
|
||||
!_sourcePublisher.IsDriverIncarnationActive(_driverInstanceId, previous))
|
||||
_sourceIncarnation = _sourcePublisher.RegisterDriverIncarnation(_driverInstanceId);
|
||||
@@ -662,6 +703,7 @@ public sealed class DriverInstanceActor : ReceiveActor, IWithTimers
|
||||
// success without touching real hardware. Read returns null; Write succeeds.
|
||||
Receive<InitializeRequested>(_ => { /* no-op */ });
|
||||
Receive<WriteAttribute>(_ => Sender.Tell(new WriteAttributeResult(true, "stubbed")));
|
||||
Receive<WriteAttributeWithOutcome>(msg => RejectRich(msg, Sender, "driver is stubbed"));
|
||||
// Stubbed drivers have no upstream alarm system — swallow the ack (it's fire-and-forget, no reply).
|
||||
Receive<RouteAlarmAck>(_ => { /* stubbed drivers have no alarm backend */ });
|
||||
Receive<DisconnectObserved>(_ => { /* stubbed drivers don't disconnect */ });
|
||||
@@ -683,6 +725,7 @@ public sealed class DriverInstanceActor : ReceiveActor, IWithTimers
|
||||
// "write timeout". Synchronous Receive: Sender.Tell on the actor thread is safe.
|
||||
Receive<WriteAttribute>(_ =>
|
||||
Sender.Tell(new WriteAttributeResult(false, "driver not connected")));
|
||||
Receive<WriteAttributeWithOutcome>(msg => RejectRich(msg, Sender, "driver not connected"));
|
||||
// A write launched while Connected can finish after the transition out of it; its slot still frees.
|
||||
Receive<WriteCompleted>(OnWriteCompleted);
|
||||
// An ack arriving while still connecting can't reach the upstream alarm system; drop it and report it
|
||||
@@ -763,6 +806,7 @@ public sealed class DriverInstanceActor : ReceiveActor, IWithTimers
|
||||
// Synchronous Receive: the device call runs off the mailbox (see StartOrQueueWrite), so data changes
|
||||
// and further writes are never head-of-line blocked behind a slow device.
|
||||
Receive<WriteAttribute>(msg => StartOrQueueWrite(msg, Sender));
|
||||
Receive<WriteAttributeWithOutcome>(msg => StartOrQueueRichWrite(msg, Sender));
|
||||
Receive<WriteCompleted>(OnWriteCompleted);
|
||||
ReceiveAsync<RouteAlarmAck>(HandleAcknowledgeAsync);
|
||||
ReceiveAsync<Subscribe>(HandleSubscribeAsync);
|
||||
@@ -993,6 +1037,7 @@ public sealed class DriverInstanceActor : ReceiveActor, IWithTimers
|
||||
// timeout on an inbound write to a transiently-down driver). Synchronous Receive.
|
||||
Receive<WriteAttribute>(_ =>
|
||||
Sender.Tell(new WriteAttributeResult(false, "driver not connected")));
|
||||
Receive<WriteAttributeWithOutcome>(msg => RejectRich(msg, Sender, "driver not connected"));
|
||||
Receive<WriteCompleted>(OnWriteCompleted);
|
||||
// An ack arriving while reconnecting can't reach the upstream alarm system; drop it and report it
|
||||
// failed so the host reverts the locally-committed acknowledge (lmxopcua#760).
|
||||
@@ -1192,13 +1237,180 @@ public sealed class DriverInstanceActor : ReceiveActor, IWithTimers
|
||||
|
||||
if (_writesInFlight >= _maxWritesInFlight || _tagsInFlight.Contains(msg.TagId))
|
||||
{
|
||||
_pendingWrites.AddLast((msg, replyTo, issuedAt));
|
||||
_pendingWrites.AddLast((msg, replyTo, issuedAt, ++_queuedWriteSequence));
|
||||
return;
|
||||
}
|
||||
|
||||
LaunchWrite(writable, msg, replyTo);
|
||||
}
|
||||
|
||||
private static readonly DataWriteOutcome RichRejected = new(DataWriteState.RejectedBeforeDispatch, 0x800A0000u, "Write rejected before dispatch.");
|
||||
private static readonly DataWriteOutcome RichUnknown = new(DataWriteState.OutcomeUnknown, 0x800A0000u, "Device outcome is unknown.");
|
||||
|
||||
private static void RejectRich(WriteAttributeWithOutcome msg, IActorRef replyTo, string reason)
|
||||
{
|
||||
var outcome = new DataWriteOutcome(DataWriteState.RejectedBeforeDispatch, 0x800A0000u, reason);
|
||||
if (msg.Claim.Complete(outcome)) msg.Ticket.Dispose();
|
||||
else outcome = msg.Claim.CurrentOutcome ?? RichUnknown;
|
||||
replyTo.Tell(outcome);
|
||||
}
|
||||
|
||||
private void StartOrQueueRichWrite(WriteAttributeWithOutcome msg, IActorRef replyTo)
|
||||
{
|
||||
if (_writeDispatchGate is null || _lateWriteObserver is null || _driver is not (IWritable or IWriteOutcomeCapability))
|
||||
{ RejectRich(msg, replyTo, "Rich writes are unavailable."); return; }
|
||||
if (_writeClock.GetElapsedTime(msg.Ticket.IssuedAt) > _queuedWriteBudget ||
|
||||
_writeClock.GetTimestamp() >= msg.Ticket.Proof.Admission.MonotonicExpiry)
|
||||
{ RejectRich(msg, replyTo, "Write expired before dispatch."); return; }
|
||||
var tag = msg.Ticket.Proof.DriverReference;
|
||||
if (_writesInFlight >= _maxWritesInFlight || _tagsInFlight.Contains(tag))
|
||||
{ _pendingRichWrites.AddLast((msg, replyTo, ++_queuedWriteSequence)); return; }
|
||||
LaunchRichWrite(msg, replyTo);
|
||||
}
|
||||
|
||||
private void LaunchRichWrite(WriteAttributeWithOutcome msg, IActorRef replyTo)
|
||||
{
|
||||
if (!_lateWriteObserver!.TryReserve(msg.Ticket.Proof.DriverInstanceId,
|
||||
msg.Ticket.Proof.DriverReference, out var reservation))
|
||||
{ RejectRich(msg, replyTo, "Outstanding driver write capacity exhausted."); return; }
|
||||
var tag = msg.Ticket.Proof.DriverReference;
|
||||
_writesInFlight++;
|
||||
_tagsInFlight.Add(tag);
|
||||
_ = RunRichWriteAsync(_driver, _invoker, ResolveHost(tag), msg, replyTo, Self,
|
||||
_writeDispatchGate!, reservation!, _writeTimeout, _writeClock, _incarnation);
|
||||
}
|
||||
|
||||
private sealed class WriteLifetime(WriteAdmissionTicket ticket, CancellationTokenSource cancellation) : IDisposable
|
||||
{
|
||||
public void Dispose() { try { ticket.Dispose(); } finally { cancellation.Dispose(); } }
|
||||
}
|
||||
|
||||
private static async Task RunRichWriteAsync(IDriver driver, IDriverCapabilityInvoker invoker, string hostKey,
|
||||
WriteAttributeWithOutcome msg, IActorRef replyTo, IActorRef self, IWriteDispatchGate gate,
|
||||
LateWriteReservation reservation, TimeSpan timeout, TimeProvider clock, int incarnation)
|
||||
{
|
||||
var physical = new TaskCompletionSource<DataWriteOutcome>(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||
var cancellation = new CancellationTokenSource(timeout, clock);
|
||||
// This task represents the entire physical invocation, including synchronous work before a driver
|
||||
// returns its task. Its permit and payload live until that invocation really exits.
|
||||
reservation.Observe(physical.Task, msg.Claim, new WriteLifetime(msg.Ticket, cancellation));
|
||||
var attempt = Task.Run(async () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
return await invoker.ExecuteWriteAsync(hostKey, false, ct =>
|
||||
{
|
||||
WriteRequest[] request;
|
||||
try { request = [new WriteRequest(msg.Ticket.Proof.DriverReference, DriverValue(msg.Ticket.Value))]; }
|
||||
catch
|
||||
{
|
||||
var noCall = msg.Claim.Complete(RichRejected) ? RichRejected : msg.Claim.CurrentOutcome ?? RichUnknown;
|
||||
if (!msg.Claim.IsDispatched) physical.TrySetResult(noCall);
|
||||
return ValueTask.FromResult(noCall);
|
||||
}
|
||||
var rejection = gate.TryCommit(msg.Ticket, msg.Claim);
|
||||
if (rejection is not null)
|
||||
{
|
||||
msg.Claim.Complete(rejection);
|
||||
physical.TrySetResult(rejection);
|
||||
return ValueTask.FromResult(rejection);
|
||||
}
|
||||
// The commit above is the linearization point. No await or external callback occurs
|
||||
// between that commit and the invocation below; preemption after commit is post-dispatch.
|
||||
try
|
||||
{
|
||||
if (driver is IWriteOutcomeCapability rich)
|
||||
_ = ObserveRichDriver(rich.WriteWithOutcomesAsync(request, ct), physical);
|
||||
else
|
||||
_ = ObserveLegacyDriver(((IWritable)driver).WriteAsync(request, ct), physical);
|
||||
}
|
||||
catch { physical.TrySetResult(RichUnknown); }
|
||||
return new ValueTask<DataWriteOutcome>(physical.Task);
|
||||
}, cancellation.Token).ConfigureAwait(false);
|
||||
}
|
||||
catch
|
||||
{
|
||||
var outcome = msg.Claim.Complete(RichRejected) ? RichRejected : RichUnknown;
|
||||
if (outcome == RichRejected) physical.TrySetResult(outcome);
|
||||
else msg.Claim.Complete(outcome);
|
||||
return outcome;
|
||||
}
|
||||
});
|
||||
try
|
||||
{
|
||||
var outcome = await attempt.WaitAsync(timeout + WriteAbandonGrace(timeout), clock).ConfigureAwait(false);
|
||||
replyTo.Tell(outcome);
|
||||
}
|
||||
catch
|
||||
{
|
||||
var outcome = msg.Claim.Complete(RichRejected) ? RichRejected : RichUnknown;
|
||||
if (outcome == RichRejected) physical.TrySetResult(outcome);
|
||||
else msg.Claim.Complete(outcome);
|
||||
replyTo.Tell(outcome);
|
||||
}
|
||||
finally { self.Tell(new WriteCompleted(msg.Ticket.Proof.DriverReference, incarnation)); }
|
||||
}
|
||||
|
||||
private static async Task ObserveRichDriver(Task<IReadOnlyList<DataWriteOutcome>> task,
|
||||
TaskCompletionSource<DataWriteOutcome> physical)
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = await task.ConfigureAwait(false);
|
||||
var outcome = result is { Count: 1 } ? result[0] : RichUnknown;
|
||||
if (outcome.State == DataWriteState.RejectedBeforeDispatch || outcome.State == DataWriteState.Unspecified) outcome = RichUnknown;
|
||||
physical.TrySetResult(outcome);
|
||||
}
|
||||
catch { physical.TrySetResult(RichUnknown); }
|
||||
}
|
||||
|
||||
private static async Task ObserveLegacyDriver(Task<IReadOnlyList<WriteResult>> task,
|
||||
TaskCompletionSource<DataWriteOutcome> physical)
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = await task.ConfigureAwait(false);
|
||||
physical.TrySetResult(result is { Count: 1 } && IsGoodStatus(result[0].StatusCode)
|
||||
? new(DataWriteState.AcceptedUnconfirmed, result[0].StatusCode, null) : RichUnknown);
|
||||
}
|
||||
catch { physical.TrySetResult(RichUnknown); }
|
||||
}
|
||||
|
||||
private static object? DriverValue(DataValue value) => value.Kind switch
|
||||
{
|
||||
DataValueKind.Null => null,
|
||||
DataValueKind.Bytes => value.GetBytes().ToArray(),
|
||||
DataValueKind.Array => ToDriverArray(value),
|
||||
_ => value.GetScalar(),
|
||||
};
|
||||
|
||||
private static Array ToDriverArray(DataValue value)
|
||||
{
|
||||
var elements = value.GetArray();
|
||||
var type = value.ArrayElementKind switch
|
||||
{
|
||||
DataValueKind.Boolean => typeof(bool), DataValueKind.Int8 => typeof(sbyte), DataValueKind.Int16 => typeof(short),
|
||||
DataValueKind.Int32 => typeof(int), DataValueKind.Int64 => typeof(long), DataValueKind.UInt8 => typeof(byte),
|
||||
DataValueKind.UInt16 => typeof(ushort), DataValueKind.UInt32 => typeof(uint), DataValueKind.UInt64 => typeof(ulong),
|
||||
DataValueKind.Float => typeof(float), DataValueKind.Double => typeof(double), DataValueKind.String => typeof(string),
|
||||
DataValueKind.Timestamp => typeof(DateTimeOffset), DataValueKind.Guid => typeof(Guid),
|
||||
_ => throw new ArgumentException("Unsupported array element kind."),
|
||||
};
|
||||
var dimensions = value.Dimensions!.ToArray();
|
||||
var result = Array.CreateInstance(type, dimensions);
|
||||
var index = new int[dimensions.Length];
|
||||
foreach (var element in elements)
|
||||
{
|
||||
result.SetValue(element, index);
|
||||
for (var d = index.Length - 1; d >= 0; d--)
|
||||
{
|
||||
if (++index[d] < dimensions[d]) break;
|
||||
index[d] = 0;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private void LaunchWrite(IWritable writable, WriteAttribute msg, IActorRef replyTo)
|
||||
{
|
||||
_writesInFlight++;
|
||||
@@ -1296,7 +1508,7 @@ public sealed class DriverInstanceActor : ReceiveActor, IWithTimers
|
||||
|
||||
private void DrainWriteQueue()
|
||||
{
|
||||
if (_driver is not IWritable writable) return;
|
||||
var writable = _driver as IWritable;
|
||||
|
||||
// Expire FIRST, over the whole queue, regardless of free slots: a write past its budget must be answered
|
||||
// now, not whenever a slot next frees and the scan happens to reach it — the host's Ask covers the budget
|
||||
@@ -1308,17 +1520,34 @@ public sealed class DriverInstanceActor : ReceiveActor, IWithTimers
|
||||
node = next;
|
||||
}
|
||||
|
||||
for (var node = _pendingWrites.First; node is not null && _writesInFlight < _maxWritesInFlight;)
|
||||
while (true)
|
||||
{
|
||||
var next = node.Next;
|
||||
var (write, replyTo, _) = node.Value;
|
||||
if (!_tagsInFlight.Contains(write.TagId))
|
||||
var before = _pendingWrites.Count + _pendingRichWrites.Count;
|
||||
for (var node = _pendingWrites.First; writable is not null && node is not null && _writesInFlight < _maxWritesInFlight;)
|
||||
{
|
||||
_pendingWrites.Remove(node);
|
||||
LaunchWrite(writable, write, replyTo);
|
||||
var next = node.Next;
|
||||
var (write, replyTo, _, sequence) = node.Value;
|
||||
if (!_tagsInFlight.Contains(write.TagId) && !_pendingRichWrites.Any(x =>
|
||||
x.Sequence < sequence && x.Write.Ticket.Proof.DriverReference == write.TagId))
|
||||
{
|
||||
_pendingWrites.Remove(node);
|
||||
LaunchWrite(writable, write, replyTo);
|
||||
}
|
||||
node = next;
|
||||
}
|
||||
|
||||
node = next;
|
||||
for (var node = _pendingRichWrites.First; node is not null;)
|
||||
{
|
||||
var next = node.Next;
|
||||
var (write, replyTo, sequence) = node.Value;
|
||||
if (_writeClock.GetElapsedTime(write.Ticket.IssuedAt) > _queuedWriteBudget ||
|
||||
_writeClock.GetTimestamp() >= write.Ticket.Proof.Admission.MonotonicExpiry)
|
||||
{ _pendingRichWrites.Remove(node); RejectRich(write, replyTo, "Write expired before dispatch."); }
|
||||
else if (_writesInFlight < _maxWritesInFlight && !_tagsInFlight.Contains(write.Ticket.Proof.DriverReference)
|
||||
&& !_pendingWrites.Any(x => x.Sequence < sequence && x.Write.TagId == write.Ticket.Proof.DriverReference))
|
||||
{ _pendingRichWrites.Remove(node); LaunchRichWrite(write, replyTo); }
|
||||
node = next;
|
||||
}
|
||||
if (_writesInFlight >= _maxWritesInFlight || before == _pendingWrites.Count + _pendingRichWrites.Count) break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1349,6 +1578,11 @@ public sealed class DriverInstanceActor : ReceiveActor, IWithTimers
|
||||
_pendingWrites.RemoveFirst();
|
||||
node.Value.ReplyTo.Tell(new WriteAttributeResult(false, reason));
|
||||
}
|
||||
while (_pendingRichWrites.First is { } rich)
|
||||
{
|
||||
_pendingRichWrites.RemoveFirst();
|
||||
RejectRich(rich.Value.Write, rich.Value.ReplyTo, reason);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2162,6 +2396,7 @@ public sealed class DriverInstanceActor : ReceiveActor, IWithTimers
|
||||
/// <inheritdoc />
|
||||
protected override void PostStop()
|
||||
{
|
||||
if (_writeIncarnation is { } writeIncarnation) _writeRouteState?.RetireDriver(_driverInstanceId, writeIncarnation);
|
||||
if (_sourceIncarnation is { } incarnation) _sourcePublisher?.RetireDriver(_driverInstanceId, incarnation);
|
||||
// Archreview 03/S15 — announce comms loss on the way out. Every OTHER route into Reconnecting
|
||||
// (watchdog trip, failed initial connect, Force Reconnect) announces it from the Reconnecting
|
||||
|
||||
Reference in New Issue
Block a user