Files
lmxopcua/tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Historian.SqlServer.Tests
Joseph Doherty 1c7e06502f fix(historian): #976 review — Gateway alarm writer isolates an unrecognised batch failure per event
#976 made StatusCode.Unknown (the gateway's handler threw) and non-RPC non-transport exceptions
RetryPlease. On the SendEvents path a RetryPlease marked the whole chunk and every later chunk
RetryPlease; with no Ack the sink treats the drain as an outage and counts nothing, so ONE such
event at the queue head stalled all Gateway alarm history until the 1,000,000-row capacity evicted
it silently. The SQL writers already isolate unrecognised failures (AlarmBatchWrite); the Gateway
writer had no equivalent.

Gateway: a RetryPlease failure that is not a known outage (IsSystemicFailure: Unavailable,
DeadlineExceeded, Cancelled, ResourceExhausted, Aborted, auth codes, typed Unavailable/auth client
exceptions, or a socket/IO/HTTP/disposed/timeout/cancellation cause) re-sends the chunk singly at
once: siblings Ack, the culprit keeps RetryPlease and dead-letters via MaxAttempts. If no single
Acks it is treated as systemic (later chunks not sent) — bounded to one chunk of singles per drain.

SQL (LOW): AlarmBatchWrite stops isolating at the first single that fails with a known outage
error; the SQL Server alarm writer passes the wider SqlHistorianConnection.IsOutage (login failed
18456/18452, unreachable/refused 2/40/53/64/121/10061/10065/-1, severity >= 20, pool timeout) —
IsTransient is unchanged for its retry callers. Fixes the false claim in docs/AlarmHistorian.md.

Tests: GatewayAlarmPoisonDrainTests (real LocalDb sink + real writer: poison at the queue head ⇒
siblings Ack on the first drain, poison dead-letters via MaxAttempts; positive control: Unavailable
outage ⇒ no single sends, nothing dead-lettered), writer-level isolation + bounded fan-out tests,
AlarmBatchWrite early-stop + no-stop-on-adjacent-poison control, SqlOutageClassificationTests.
2026-12-03 12:01:24 -05:00
..