From 22ef2eb5bacf8a150556457a85cd039e7df55c67 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Wed, 29 Apr 2026 17:03:06 -0400 Subject: [PATCH] =?UTF-8?q?PR=206.5=20=E2=80=94=20Tune=20MxGatewayClientOp?= =?UTF-8?q?tions=20defaults?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .../Config/GalaxyDriverOptions.cs | 11 ++++++++++- .../GalaxyDriverFactoryExtensions.cs | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/ZB.MOM.WW.OtOpcUa.Driver.Galaxy/Config/GalaxyDriverOptions.cs b/src/ZB.MOM.WW.OtOpcUa.Driver.Galaxy/Config/GalaxyDriverOptions.cs index 7362f54..3df8a79 100644 --- a/src/ZB.MOM.WW.OtOpcUa.Driver.Galaxy/Config/GalaxyDriverOptions.cs +++ b/src/ZB.MOM.WW.OtOpcUa.Driver.Galaxy/Config/GalaxyDriverOptions.cs @@ -22,13 +22,22 @@ public sealed record GalaxyDriverOptions( /// through the server-side secret store (DPAPI for production, environment override for /// dev) — the API key never appears in cleartext config. /// +// 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( string Endpoint, string ApiKeySecretRef, bool UseTls = true, string? CaCertificatePath = null, int ConnectTimeoutSeconds = 10, - int DefaultCallTimeoutSeconds = 5, + int DefaultCallTimeoutSeconds = 30, int StreamTimeoutSeconds = 0); /// diff --git a/src/ZB.MOM.WW.OtOpcUa.Driver.Galaxy/GalaxyDriverFactoryExtensions.cs b/src/ZB.MOM.WW.OtOpcUa.Driver.Galaxy/GalaxyDriverFactoryExtensions.cs index b9cc8ce..0e0f6dc 100644 --- a/src/ZB.MOM.WW.OtOpcUa.Driver.Galaxy/GalaxyDriverFactoryExtensions.cs +++ b/src/ZB.MOM.WW.OtOpcUa.Driver.Galaxy/GalaxyDriverFactoryExtensions.cs @@ -54,7 +54,7 @@ public static class GalaxyDriverFactoryExtensions UseTls: dto.Gateway.UseTls ?? true, CaCertificatePath: dto.Gateway.CaCertificatePath, ConnectTimeoutSeconds: dto.Gateway.ConnectTimeoutSeconds ?? 10, - DefaultCallTimeoutSeconds: dto.Gateway.DefaultCallTimeoutSeconds ?? 5, + DefaultCallTimeoutSeconds: dto.Gateway.DefaultCallTimeoutSeconds ?? 30, StreamTimeoutSeconds: dto.Gateway.StreamTimeoutSeconds ?? 0), MxAccess: new GalaxyMxAccessOptions( ClientName: dto.MxAccess?.ClientName