PR 6.5 — Tune MxGatewayClientOptions defaults

Bumps DefaultCallTimeoutSeconds from 5 → 30. The 5s default was
provably unsafe regardless of soak data: a 50k-tag SubscribeBulk
walks the gw worker's item list serially under the MxAccess COM
apartment lock, and that scan can exceed 5s on a busy node. 30s
leaves comfortable headroom for the legitimate worst case while
still failing fast on a wedged worker.

ConnectTimeoutSeconds (10) and StreamTimeoutSeconds (0 = unlimited)
unchanged — the soak harness in PR 6.4 didn't observe pressure on
either, so they stay at their original sane values until live data
indicates otherwise.

Tuning rationale captured as a code comment in GalaxyGatewayOptions
so the next reader knows what was deliberate and what's pending live
soak data.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Joseph Doherty
2026-04-29 17:03:06 -04:00
parent 698bdef572
commit 22ef2eb5ba
2 changed files with 11 additions and 2 deletions

View File

@@ -22,13 +22,22 @@ public sealed record GalaxyDriverOptions(
/// through the server-side secret store (DPAPI for production, environment override for /// through the server-side secret store (DPAPI for production, environment override for
/// dev) — the API key never appears in cleartext config. /// dev) — the API key never appears in cleartext config.
/// </summary> /// </summary>
// PR 6.5 tuning notes:
// ConnectTimeoutSeconds = 10 — cold-start network path comfort margin; soak runs
// never saw a successful connect take >2s, so 10s is generous without being lax.
// DefaultCallTimeoutSeconds = 30 — bumped from 5s because a 50k-tag SubscribeBulk
// can exceed 5s under MxAccess COM contention (the worker walks the gw item list
// serially under the apartment lock). 30s leaves comfortable headroom for the
// legitimate worst case while still failing fast on a wedged worker.
// StreamTimeoutSeconds = 0 — unlimited; the StreamEvents RPC must run for the
// lifetime of the driver. Set a finite value only for diagnostic runs.
public sealed record GalaxyGatewayOptions( public sealed record GalaxyGatewayOptions(
string Endpoint, string Endpoint,
string ApiKeySecretRef, string ApiKeySecretRef,
bool UseTls = true, bool UseTls = true,
string? CaCertificatePath = null, string? CaCertificatePath = null,
int ConnectTimeoutSeconds = 10, int ConnectTimeoutSeconds = 10,
int DefaultCallTimeoutSeconds = 5, int DefaultCallTimeoutSeconds = 30,
int StreamTimeoutSeconds = 0); int StreamTimeoutSeconds = 0);
/// <summary> /// <summary>

View File

@@ -54,7 +54,7 @@ public static class GalaxyDriverFactoryExtensions
UseTls: dto.Gateway.UseTls ?? true, UseTls: dto.Gateway.UseTls ?? true,
CaCertificatePath: dto.Gateway.CaCertificatePath, CaCertificatePath: dto.Gateway.CaCertificatePath,
ConnectTimeoutSeconds: dto.Gateway.ConnectTimeoutSeconds ?? 10, ConnectTimeoutSeconds: dto.Gateway.ConnectTimeoutSeconds ?? 10,
DefaultCallTimeoutSeconds: dto.Gateway.DefaultCallTimeoutSeconds ?? 5, DefaultCallTimeoutSeconds: dto.Gateway.DefaultCallTimeoutSeconds ?? 30,
StreamTimeoutSeconds: dto.Gateway.StreamTimeoutSeconds ?? 0), StreamTimeoutSeconds: dto.Gateway.StreamTimeoutSeconds ?? 0),
MxAccess: new GalaxyMxAccessOptions( MxAccess: new GalaxyMxAccessOptions(
ClientName: dto.MxAccess?.ClientName ClientName: dto.MxAccess?.ClientName