chore(communication): low-severity cleanup — eviction counting, shared ingest timeout, split app heartbeat interval, doc notes

This commit is contained in:
Joseph Doherty
2026-07-08 21:54:42 -04:00
parent 11c72ecf0f
commit 846279f6a8
7 changed files with 63 additions and 21 deletions
@@ -137,20 +137,18 @@ public class CentralCommunicationActor : ReceiveActor
/// <summary>
/// Default Ask timeout for routing audit ingest commands to the
/// AuditLogIngestActor proxy — 30 s, matching the value of
/// <c>SiteStreamGrpcServer.AuditIngestAskTimeout</c> (that constant is private
/// to the gRPC server and not reachable here, so it is declared locally). A
/// generous window absorbs a slow MS SQL connection without the round-trip
/// surfacing as a failure on a healthy site. When the window is exceeded the
/// Ask faults and that fault is piped back to the caller as a
/// <see cref="Status.Failure"/> (see <see cref="HandleIngestAuditEvents"/>).
/// </summary>
private static readonly TimeSpan DefaultAuditIngestAskTimeout = TimeSpan.FromSeconds(30);
/// <summary>
/// Effective Ask timeout for audit ingest routing. Defaults to
/// <see cref="DefaultAuditIngestAskTimeout"/>; overridable via the constructor
/// so tests can exercise the timeout/fault path without waiting 30 s.
/// <see cref="Grpc.SiteStreamGrpcServer.AuditIngestAskTimeout"/> (30 s) — the two
/// audit-ingest transports (gRPC vs ClusterClient) now share one source of truth
/// for the timeout. Overridable via the constructor so tests can exercise the
/// timeout/fault path without waiting 30 s. When the window is exceeded the Ask
/// faults and that fault is piped back to the caller as a
/// <see cref="Status.Failure"/> (see <see cref="HandleIngestAuditEvents"/>).
///
/// The gRPC and ClusterClient ingest transports differ in fault semantics (the
/// gRPC handler surfaces the fault as an RpcException; here it becomes a piped
/// Status.Failure). Consolidating the two ingest transports is a scheduled
/// follow-up — see arch review 02, Underdeveloped #1.
/// </summary>
private readonly TimeSpan _auditIngestAskTimeout;
@@ -166,7 +164,7 @@ public class CentralCommunicationActor : ReceiveActor
/// <param name="siteClientFactory">Factory used to create per-site ClusterClient actors.</param>
/// <param name="auditIngestAskTimeout">
/// Optional override for the audit-ingest Ask timeout; defaults to
/// <see cref="DefaultAuditIngestAskTimeout"/> (30 s). Exists only so tests can
/// <see cref="Grpc.SiteStreamGrpcServer.AuditIngestAskTimeout"/> (30 s). Exists only so tests can
/// exercise the timeout/fault path quickly — production always uses the default.
/// </param>
public CentralCommunicationActor(
@@ -176,7 +174,7 @@ public class CentralCommunicationActor : ReceiveActor
{
_serviceProvider = serviceProvider;
_siteClientFactory = siteClientFactory;
_auditIngestAskTimeout = auditIngestAskTimeout ?? DefaultAuditIngestAskTimeout;
_auditIngestAskTimeout = auditIngestAskTimeout ?? Grpc.SiteStreamGrpcServer.AuditIngestAskTimeout;
// Site address cache loaded from database
Receive<SiteAddressCacheLoaded>(HandleSiteAddressCacheLoaded);