OPCFoundation / UA-.NETStandard

OPC Unified Architecture .NET Standard
Other
1.9k stars 926 forks source link

Reduce locking in secure channel client send/receive codepath #2531

Closed mregen closed 4 months ago

mregen commented 4 months ago

Proposed changes

During high load there were a few portions in the send/receive pipeline identified which may cause lock contention and thread starvation due to locks:

Due to the change it is possible to send KeepAlive even when a incoming message is received.

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.

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.

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

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 62.50000% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 53.98%. Comparing base (22096f4) to head (85da87f).

Files Patch % Lines
Stack/Opc.Ua.Core/Stack/Tcp/UaSCBinaryChannel.cs 33.33% 4 Missing :warning:
...k/Opc.Ua.Core/Stack/Tcp/UaSCBinaryClientChannel.cs 80.00% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2531 +/- ## ========================================== + Coverage 53.97% 53.98% +0.01% ========================================== Files 335 335 Lines 64526 64524 -2 Branches 13267 13268 +1 ========================================== + Hits 34826 34832 +6 + Misses 25939 25932 -7 + Partials 3761 3760 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

mregen commented 4 months ago

found an issue due to new exceptions -- investigating