Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix server time and move all readerwriter locks outside of try/finally #2903

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

mregen
Copy link
Contributor

@mregen mregen commented Dec 11, 2024

Proposed changes

  • Fix server time source timestamp is not updated.
    There are duplicate objects in generated code, on of which which holds the last timestamp was not updated.

  • Move all readerwriter locks outside of try/finally to avoid a SynchronizationLockException when a reader writer lock is disposed or is cancelled.

Currently there is no obvious fundamental bug in how the readerwriter locks are used, but outside the try/finally clause e.g. a disposed lock may not trigger a false exception.

Related Issues

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...

@mregen mregen requested review from mrsuciu and Copilot December 11, 2024 14:39
@mregen mregen changed the base branch from master to develop/main374 December 11, 2024 14:39

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 5 changed files in this pull request and generated no suggestions.

Comments skipped due to low confidence (1)

Libraries/Opc.Ua.Server/Server/ServerInternalData.cs:747

  • [nitpick] The variable name serverStatusValue is ambiguous. It should be renamed to statusValue for better clarity.
if (variable is ServerStatusValue serverStatusValue &&
Copy link

codecov bot commented Dec 11, 2024

Codecov Report

Attention: Patch coverage is 86.53846% with 7 lines in your changes missing coverage. Please review.

Project coverage is 57.42%. Comparing base (67a0df1) to head (856af6d).
Report is 1 commits behind head on develop/main374.

Files with missing lines Patch % Lines
Libraries/Opc.Ua.Client/NodeCache/NodeCache.cs 78.57% 6 Missing ⚠️
...ck/Opc.Ua.Core/Types/Encoders/EncodeableFactory.cs 83.33% 1 Missing ⚠️
Additional details and impacted files
@@                 Coverage Diff                 @@
##           develop/main374    #2903      +/-   ##
===================================================
+ Coverage            54.96%   57.42%   +2.46%     
===================================================
  Files                  349      352       +3     
  Lines                66354    76039    +9685     
  Branches             13619    16107    +2488     
===================================================
+ Hits                 36470    43669    +7199     
- Misses               25906    27895    +1989     
- Partials              3978     4475     +497     

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

@mregen mregen marked this pull request as ready for review December 11, 2024 14:45
@mregen mregen requested a review from Copilot December 11, 2024 14:45

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 5 changed files in this pull request and generated no suggestions.

@mregen mregen requested a review from romanett December 13, 2024 07:01
@mregen mregen merged commit dc661ba into develop/main374 Dec 13, 2024
120 checks passed
@mregen mregen deleted the servertimeandlocks branch December 13, 2024 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants