fix(alarms): #937 review r2 — deadline/poison refusals unsent, Call size quota, expired asks skip the engine, mutation-counter revert guard

M1: a scripted method whose request deadline leaves < the dispatch floor, or that
follows an unanswered scripted method in the same Call, is refused BadTimeout in
its handler (unsent, unapplied); OpcUa:Quotas:MaxNodesPerMethodCall = 1000.
M2: ExecuteAlarmCommand carries the asker's deadline; an expired ask skips the
engine and is not remembered (the broadcast copy applies).
L1: revert guarded by a per-condition mutation counter; raw severity restored.
L5 + nits: docs, stale comment. SDK check: no Part 9 handler calls our delegate
before its own validation.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Joseph Doherty
2026-11-28 12:47:08 -05:00
parent 2d54d9d671
commit e42e666a1d
12 changed files with 249 additions and 25 deletions
@@ -271,6 +271,14 @@ public sealed class OpcUaQuotaOptions
/// burst ceiling review 01 P6 flagged.</summary>
public int MaxQueuedRequestCount { get; set; } = 200;
/// <summary>
/// Most methods one Call request may carry (advertised as <c>OperationLimits/MaxNodesPerMethodCall</c>; a larger
/// request is refused <c>BadTooManyOperations</c> by the SDK). Default 1000 — the SDK default is 0 = unlimited, and
/// #937 settles a batch's scripted-alarm methods one at a time against the engine, so an unbounded batch is an
/// unbounded request. 0 = unlimited.
/// </summary>
public uint MaxNodesPerMethodCall { get; set; } = 1000;
/// <summary>Per-operation timeout in milliseconds; <c>null</c> keeps the SDK default.</summary>
public int? OperationTimeoutMs { get; set; }
@@ -860,6 +868,8 @@ public sealed class OpcUaApplicationHost : IAsyncDisposable
serverConfig.MinRequestThreadCount = quotas.MinRequestThreadCount;
serverConfig.MaxRequestThreadCount = quotas.MaxRequestThreadCount;
serverConfig.MaxQueuedRequestCount = quotas.MaxQueuedRequestCount;
serverConfig.OperationLimits ??= new OperationLimits();
serverConfig.OperationLimits.MaxNodesPerMethodCall = quotas.MaxNodesPerMethodCall;
}
/// <summary>