Repository navigation
fix(opcua): per-source ConditionRefresh, ordered report and clear, array event fields - #782
Closed
mfaferek93 wants to merge 4 commits into
Closed
mfaferek93 wants to merge 4 commits into
mfaferek93 wants to merge 4 commits into
Conversation
Part 9 brackets the refresh replay on every event item of the subscription, and each item only carries its own notifier's conditions. With two alarm sources the second RefreshEnd reconciled every tracked condition against its own burst and cleared the first source's live alarms. The replayed set and the reconcile are now kept per source, and an End without a Start is ignored.
isType<T>() is true for an array of T, so getScalarCopy threw BadVariantAccess when an event field (Severity, Message, ConditionName, an associated value) or a condition property read in the read-based replay was an array: the notification was dropped, or the throw left the poll thread. Every scalar read in those paths now checks isScalar() first.
ReportFault and ClearFault are separate services, so an alarm that came and went inside one publishing interval could reach fault_manager clear first and stay raised for good. Calls for one code now go out one at a time, each after the previous was answered (an unanswered call holds its code for at most 5 s).
plugins.opcua.auto_browse.infer_writable: false, set on its own beside a curated node map, enabled the walk because "enabled" defaulted to true for any object. Without "enabled" only a walk knob turns it on now. Also accept match_message in the event_alarms mapping key check: it was parsed but reported as an unknown key.
Collaborator
Author
|
Superseded by #783, which carries this change as its own commit. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Four OPC UA plugin fixes found running the plugin against a companion-spec server with two machines, each machine object its own alarm notifier. Stacked on #781 (it needs
fault_enum.ok_valuesand the array read fix from there); the diff below is only the four commits on top.event_alarmssources, the second item's RefreshEnd reconciled every tracked condition against its own burst and cleared the first source's live alarms after every reconnect. The replayed set and the reconcile are now per source, and a RefreshEnd without its RefreshStart reconciles nothing.Fault cleared: Xfollowed byNew fault reported: X). Calls for one code now go out one at a time, each after the previous was answered (FaultCodeLanes). Other codes do not wait, and an unanswered call holds its code for at most 5 s.isType<T>()+getScalarCopypattern: an array Severity, Message, ConditionName or associated value threw out ofon_event, and the notification was dropped. Same in the read-based condition replay. Those reads now checkisScalar().auto_browse.infer_writablealone no longer enables the walk. The object form defaultedenabledto true, so a read-only guard set beside a curated node map (auto_browse: false) turned the walk on. Withoutenabled, only a walk knob (root_nodes,max_depth, ...) turns it on now. Alsomatch_messageis accepted by the mapping key check: it was parsed but logged as an unknown key and "ignored".Issue
event_alarmsentry per machine object.Type
Testing
test_opcua_poller:ConditionRefreshTest.EachSourceReconcilesOnlyItsOwnConditions(two sources, refresh bracketed on both, then one source alone, then a stray End) andEventFieldsTest.AnArrayFieldDoesNotDropTheEvent. With the old reconcile the first fails ({ "B_ALARM", "A_ALARM" }cleared, want{ "A_ALARM" }); without the event-path guard the second fails.test_fault_code_lanes(new, no ROS): order kept for one code, other codes do not wait, several calls in a row, stale call released and its late answer ignored, synchronous answers.test_opcua_plugin:InferWritableAloneKeepsTheWalkOff,WalkKnobWithoutEnabledTurnsTheWalkOn.Checklist