Skip to content

Conversation

@marcschier
Copy link
Collaborator

@marcschier marcschier commented Oct 7, 2025

Replaced Queue with ConcurrentQueue in MonitoredItemDataCache for thread-safe operations. Updated Publish method to use List for better handling of dequeued values. Enhanced logging to include SourceTime and added logs for dropped values.

In DurableSubscriptionTest, added try-finally block to ensure proper session closure and disposal, preventing memory leaks. Introduced DurableSubscriptionTestLooper for stress testing under debug mode. Refactored test code for improved readability.

Proposed changes

Describe the changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.

Related Issues

  • Fixes #

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply. You can also fill these out after creating the PR.

  • Bugfix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which adds functionality)
  • Test enhancement (non-breaking change to increase test coverage)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected, requires version increase of Nuget packages)
  • Documentation Update (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING doc.
  • I have signed the CLA.
  • I ran tests locally with my changes, all passed.
  • I fixed all failing tests in the CI pipelines.
  • I fixed all introduced issues with CodeQL and LGTM.
  • I have added tests that prove my fix is effective or that my feature works and increased code coverage.
  • I have added necessary documentation (if appropriate).
  • Any dependent changes have been merged and published in downstream modules.

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

Replaced Queue with ConcurrentQueue in MonitoredItemDataCache
for thread-safe operations. Updated Publish method to use
List<DataValue> for better handling of dequeued values. Enhanced
logging to include SourceTime and added logs for dropped values.

In DurableSubscriptionTest, added try-finally block to ensure
proper session closure and disposal, preventing memory leaks.
Introduced DurableSubscriptionTestLooper for stress testing
under debug mode. Refactored test code for improved readability.
@codecov
Copy link

codecov bot commented Oct 7, 2025

Codecov Report

❌ Patch coverage is 51.00671% with 73 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.70%. Comparing base (01ffcee) to head (3f3c64d).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
Libraries/Opc.Ua.Client/Session/Session.cs 48.14% 20 Missing and 8 partials ⚠️
...raries/Opc.Ua.Client/Subscription/MonitoredItem.cs 22.72% 14 Missing and 3 partials ⚠️
Stack/Opc.Ua.Core/Types/Utils/ServiceResult.cs 60.86% 5 Missing and 4 partials ⚠️
...aries/Opc.Ua.Server/NodeManager/CoreNodeManager.cs 0.00% 6 Missing ⚠️
...braries/Opc.Ua.Client/Subscription/Subscription.cs 78.57% 0 Missing and 3 partials ⚠️
...MonitoredItem/SamplingGroupMonitoredItemManager.cs 0.00% 3 Missing ⚠️
Stack/Opc.Ua.Core/Stack/Server/ServerBase.cs 0.00% 2 Missing ⚠️
...k/Opc.Ua.Core/Stack/Tcp/UaSCBinaryClientChannel.cs 0.00% 2 Missing ⚠️
...ibraries/Opc.Ua.Client/Session/TraceableSession.cs 0.00% 1 Missing ⚠️
Libraries/Opc.Ua.Server/Server/StandardServer.cs 0.00% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3243      +/-   ##
==========================================
- Coverage   57.77%   57.70%   -0.07%     
==========================================
  Files         362      362              
  Lines       79251    79301      +50     
  Branches    13840    13853      +13     
==========================================
- Hits        45786    45760      -26     
- Misses      29242    29293      +51     
- Partials     4223     4248      +25     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@marcschier marcschier marked this pull request as ready for review October 8, 2025 06:12
Updated logging in `Session.cs`, `ServerBase.cs`, and `UaSCBinaryClientChannel.cs` to pass exceptions directly to the logger, enhancing error handling. Added connection state checks in `Session.cs` to prevent operations when the session is closed or never connected. Updated `Subscription.cs` to reflect session disconnection in `PublishingStopped`. Enhanced test outputs and renamed `DurableSubscriptionTestLooper` to `DurableSubscriptionTestDebug` in `DurableSubscriptionTest.cs`, reducing loop count for faster debug testing.
… allocate a free monitored item id in the table, then committing.
Added detailed logging in `AlarmNodeManager.cs` for lifecycle events and simulation control. Introduced a `Reconnecting` property in the `ISession` interface and `Session.cs` to manage session reconnection state, replacing the `m_reconnecting` field. Enhanced logging in `Session.cs` for reconnection and publish operations. Updated `DataGenerator.cs` to use `FrozenDictionary` for performance improvements. Replaced `SyncRoot` with `m_syncRoot` in `NamespaceTable.cs` for synchronization. Improved exception message formatting in `ServiceResult.cs`. Added necessary namespaces for new data structures. Made corrections and added debugging in `DurableSubscriptionTest.cs` for better session handling.
@marcschier marcschier merged commit 4c651d0 into master Oct 11, 2025
118 of 120 checks passed
@marcschier marcschier deleted the teststability branch October 11, 2025 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants