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 degradation to sync calls in the SDK on main paths used. #2316

Merged
merged 9 commits into from
Sep 22, 2023
Merged

Conversation

marcschier
Copy link
Contributor

Proposed changes

There are several calls in the client SDK that end up degrading into synchronous calls. In particular

  1. Session.FetchNamespaceTables
  2. Session.Open (-> DefaultSessionFactory.Create)
  3. NodeCache Get (-> Complex data type system load operation)

When these degrade they block the thread pool and that means session creation and usage are limited by the size of the thread pool, and that many threads will be idle while waiting for network IO.

Related Issues

  • The TCP secure channel implementation blocks on End and thus eventually all calls degrade to blocking. This is a larger issue that will be handled by @mregen.

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.

@marcschier marcschier changed the title Make Open session and Fetch namespace table async Fix degradation to sync calls in the SDK on main paths used. Sep 20, 2023
@codecov
Copy link

codecov bot commented Sep 20, 2023

Codecov Report

Patch coverage: 61.49% and project coverage change: +0.01% 🎉

Comparison is base (c6ee32a) 59.05% compared to head (40a389e) 59.06%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2316      +/-   ##
==========================================
+ Coverage   59.05%   59.06%   +0.01%     
==========================================
  Files         330      331       +1     
  Lines       63646    64141     +495     
==========================================
+ Hits        37586    37887     +301     
- Misses      26060    26254     +194     
Files Changed Coverage Δ
Libraries/Opc.Ua.Client/DefaultSessionFactory.cs 61.81% <0.00%> (-2.34%) ⬇️
Libraries/Opc.Ua.Client/NodeCache.cs 71.49% <ø> (+1.44%) ⬆️
Stack/Opc.Ua.Core/Stack/Client/DiscoveryClient.cs 65.32% <ø> (ø)
Stack/Opc.Ua.Core/Stack/Nodes/TypeTable.cs 53.49% <0.00%> (-0.38%) ⬇️
.../Opc.Ua.Core/Types/Utils/ServiceResultException.cs 55.76% <ø> (ø)
Stack/Opc.Ua.Core/Types/Utils/TypeInfo.cs 43.95% <0.00%> (-0.54%) ⬇️
Libraries/Opc.Ua.Client/TraceableSession.cs 49.24% <42.85%> (-0.15%) ⬇️
Libraries/Opc.Ua.Client/SessionAsync.cs 72.52% <48.32%> (-17.02%) ⬇️
...Ua.Core/Stack/Configuration/ConfiguredEndpoints.cs 19.36% <50.00%> (ø)
...Opc.Ua.Core/Types/Schemas/BinarySchemaValidator.cs 67.79% <60.00%> (ø)
... and 6 more

... and 18 files with indirect coverage changes

☔ 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 September 22, 2023 06:36
@mregen mregen merged commit af04893 into master Sep 22, 2023
72 checks passed
@mregen mregen deleted the goasync branch September 22, 2023 10:17
@mregen mregen added this to the 1.4.372 updates milestone Oct 25, 2023
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.

None yet

2 participants