fix(auditlog): do not log a graceful-stop OperationCanceledException at Error in the telemetry drains (review 2026-10-21 06/COR-2)
This commit is contained in:
@@ -163,8 +163,8 @@ public class SiteAuditTelemetryActor : ReceiveActor
|
||||
// Route every async dependency call through the
|
||||
// per-actor lifecycle token so PostStop cancellation actually
|
||||
// propagates into the queue read, the gRPC push, and the
|
||||
// mark-forwarded write. OperationCanceledException is swallowed by
|
||||
// the catch-all below.
|
||||
// mark-forwarded write. A shutdown-driven OperationCanceledException is
|
||||
// swallowed silently by the dedicated catch below.
|
||||
var ct = _lifecycleCts.Token;
|
||||
try
|
||||
{
|
||||
@@ -204,6 +204,12 @@ public class SiteAuditTelemetryActor : ReceiveActor
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
catch (OperationCanceledException) when (ct.IsCancellationRequested)
|
||||
{
|
||||
// Graceful stop: PostStop cancelled the lifecycle token while the drain
|
||||
// was awaiting the queue / gRPC push. Expected on every orderly shutdown or
|
||||
// failover — not an error (review 2026-10-21 06/COR-2).
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// Catch-all so a SQLite hiccup or mapper bug never crashes the
|
||||
@@ -382,6 +388,10 @@ public class SiteAuditTelemetryActor : ReceiveActor
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
catch (OperationCanceledException) when (ct.IsCancellationRequested)
|
||||
{
|
||||
// Graceful stop mid-drain — see OnDrainAsync (review 2026-10-21 06/COR-2).
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex,
|
||||
|
||||
Reference in New Issue
Block a user