fix(historian): defensive over-fetch cap + Validate gating comment (review)

This commit is contained in:
Joseph Doherty
2026-06-17 20:22:07 -04:00
parent 4e1414026e
commit 0f929ae668
2 changed files with 6 additions and 1 deletions
@@ -1902,7 +1902,9 @@ public sealed class OtOpcUaNodeManager : CustomNodeManager2
// The over-fetch cap MUST be explicit and non-zero: a cap of 0 falls back to the backend's
// MaxValuesPerRead, which would re-introduce the very stall we're escaping. +1 over the bound
// lets us DETECT a cluster strictly larger than the bound (the absurd-burst backstop below).
var overfetchCap = (uint)(MaxTieClusterOverfetch + 1);
// Compute in uint so +1 can never wrap: Math.Max(1,…) also guards against a zero/negative
// config value slipping through (Validate() warns but does not block startup).
var overfetchCap = (uint)Math.Max(1, MaxTieClusterOverfetch) + 1u;
var cluster = HistorianDataSource
.ReadRawAsync(tagname, startUtc, startUtc, overfetchCap, CancellationToken.None)
.GetAwaiter().GetResult().Samples;