Handle RefreshRequiredEventType from OtOpcUa (trigger ConditionRefresh) #148

Closed
opened 2026-11-24 22:59:06 -05:00 by dohertj2 · 1 comment
Owner

OtOpcUa (lmxopcua gRPC data connections A3/A4) now emits RefreshRequiredEventType for the first time — on an incomplete condition snapshot, a removed imported condition, or after a resync that invalidates EventIds (a pre-failover EventId then answers BadEventIdUnknown).

ScadaBridge's event handling (RealOpcUaClient.cs:1211-1240) has no RefreshRequired branch: the event falls through as a 'condition' keyed Server, and no ConditionRefresh is issued, so ScadaBridge can hold stale alarm state / un-ackable EventIds. Per OPC UA Part 9, on RefreshRequired the client should call ConditionRefresh (or ConditionRefresh2 for the monitored item) and not treat the event as an alarm.

Needed before OtOpcUa's alarm-forwarding (A4) is fleet-deployed.

OtOpcUa (lmxopcua gRPC data connections A3/A4) now emits `RefreshRequiredEventType` for the first time — on an incomplete condition snapshot, a removed imported condition, or after a resync that invalidates EventIds (a pre-failover EventId then answers BadEventIdUnknown). ScadaBridge's event handling (`RealOpcUaClient.cs:1211-1240`) has no RefreshRequired branch: the event falls through as a 'condition' keyed `Server`, and no ConditionRefresh is issued, so ScadaBridge can hold stale alarm state / un-ackable EventIds. Per OPC UA Part 9, on RefreshRequired the client should call ConditionRefresh (or ConditionRefresh2 for the monitored item) and not treat the event as an alarm. Needed before OtOpcUa's alarm-forwarding (A4) is fleet-deployed.
dohertj2 added the type:bugpriority:p1cross-repo labels 2026-11-24 22:59:06 -05:00
Author
Owner

Fixed in a117f79a (main @ d4d5be3b). A RefreshRequiredEventType event is no longer mapped as an alarm. It now triggers a ConditionRefresh. The refresh runs on a background loop, waits 500 ms so a burst of events causes one refresh, never runs two refreshes at once, and logs failures instead of throwing. It uses ConditionRefresh2 for each item that asked, and falls back to a subscription-wide ConditionRefresh when that isn't possible. The refresh replay goes through the existing RefreshStart/RefreshEnd snapshot swap, so conditions the new snapshot no longer lists are cleared. The per-item event filter now always lets RefreshRequired through, so a condition-type filter can't drop it on the server side. Unit-tested only: not yet checked against a live OtOpcUa A3/A4 node.

Fixed in a117f79a (main @ d4d5be3b). A `RefreshRequiredEventType` event is no longer mapped as an alarm. It now triggers a ConditionRefresh. The refresh runs on a background loop, waits 500 ms so a burst of events causes one refresh, never runs two refreshes at once, and logs failures instead of throwing. It uses `ConditionRefresh2` for each item that asked, and falls back to a subscription-wide `ConditionRefresh` when that isn't possible. The refresh replay goes through the existing RefreshStart/RefreshEnd snapshot swap, so conditions the new snapshot no longer lists are cleared. The per-item event filter now always lets RefreshRequired through, so a condition-type filter can't drop it on the server side. Unit-tested only: not yet checked against a live OtOpcUa A3/A4 node.
Sign in to join this conversation.