OpcUaClient alarm RefreshEnd can signal 'state known' over lost refreshed events (queue overflow / gap) #926

Closed
opened 2026-11-24 11:12:53 -05:00 by dohertj2 · 1 comment
Owner

A1 (gRPC data alarm forwarding, docs/plans/2026-11-23-grpc-data-connections-history-alarms-plan.md §5.1) uses the OpcUaClient driver's RefreshEndEventType as the InitialAlarmStateDelivered signal: after it, the conditions it covers are declared state-known.

Residual risk: if refreshed events are lost, RefreshEnd still signals, and a condition that is active upstream can be declared known-inactive.

  • The SDK does not expose a publish sequence gap to the driver. SequentialPublishing plus republish covers the ordinary case.
  • The more likely variant: the event monitored item is QueueSize = 1000, DiscardOldest = false, with the source filter applied client-side (OpcUaClientDriver.cs ~2577, ~2838). A refresh of more than 1,000 retained upstream conditions in one publish cycle can overflow the server queue and still deliver RefreshEnd. This is not verified against a server.

Proposed mitigation:

  • Track a RefreshStart…RefreshEnd bracket.
  • If an EventQueueOverflowEventType or a RefreshRequired arrives inside the bracket, suppress the signal and re-run ConditionRefresh.
  • Consider a larger queue for the alarm item.
  • Add a test with an overflowing fake server.

Also: correct the plan's G2 sentence ("a sequence gap during a refresh ⇒ that RefreshEnd does not signal"). It is not implemented as written.

A1 (gRPC data alarm forwarding, `docs/plans/2026-11-23-grpc-data-connections-history-alarms-plan.md` §5.1) uses the OpcUaClient driver's `RefreshEndEventType` as the `InitialAlarmStateDelivered` signal: after it, the conditions it covers are declared state-known. **Residual risk:** if refreshed events are lost, `RefreshEnd` still signals, and a condition that is active upstream can be declared known-inactive. - The SDK does not expose a publish sequence gap to the driver. `SequentialPublishing` plus republish covers the ordinary case. - The more likely variant: the event monitored item is `QueueSize = 1000`, `DiscardOldest = false`, with the source filter applied client-side (`OpcUaClientDriver.cs` ~2577, ~2838). A refresh of more than 1,000 retained upstream conditions in one publish cycle can overflow the server queue and still deliver `RefreshEnd`. This is not verified against a server. **Proposed mitigation:** - Track a `RefreshStart`…`RefreshEnd` bracket. - If an `EventQueueOverflowEventType` or a `RefreshRequired` arrives inside the bracket, suppress the signal and re-run ConditionRefresh. - Consider a larger queue for the alarm item. - Add a test with an overflowing fake server. **Also:** correct the plan's G2 sentence ("a sequence gap during a refresh ⇒ that RefreshEnd does not signal"). It is not implemented as written.
dohertj2 added the type:followuppriority:p2 labels 2026-11-24 11:12:53 -05:00
Author
Owner

Fixed on master 4ac83085. RefreshEnd signals only for a lossless RefreshStart…RefreshEnd bracket (no overflow, RefreshRequired, nested start, or driver-tracked publish sequence gap); lossy ⇒ bounded re-ConditionRefresh; a post-signal loss withdraws 'known' (new AlarmInitialStateEventArgs.Withdrawn) until a clean bracket; deferred alarm/mark replay in arrival order. Queue 1000→10000. Plan G2 sentence corrected. Live overflow gate vs opc-plc: evidence docs/plans/evidence/grpc-data-ext/926-refresh-bracket.md.

Fixed on master 4ac83085. RefreshEnd signals only for a lossless RefreshStart…RefreshEnd bracket (no overflow, RefreshRequired, nested start, or driver-tracked publish sequence gap); lossy ⇒ bounded re-ConditionRefresh; a post-signal loss withdraws 'known' (new AlarmInitialStateEventArgs.Withdrawn) until a clean bracket; deferred alarm/mark replay in arrival order. Queue 1000→10000. Plan G2 sentence corrected. Live overflow gate vs opc-plc: evidence docs/plans/evidence/grpc-data-ext/926-refresh-bracket.md.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dohertj2/lmxopcua#926