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 reopen secure channel without activate #2577

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Conversation

mregen
Copy link
Contributor

@mregen mregen commented Apr 3, 2024

Proposed changes

If a socket is closed, new service calls are queued and a new channel is established without reconnect / activate.
Add some logic which ensures that a BeginConnect operation is only started if a valid service call is queued first.
The activate is prepared by the session reconnect handler which may take some time to respond. Until then, all other service fail immediately with BadNotConnected.
Wiring up the socket failure turns out to be quite complicated, so going for the safer fix to fail the packets until BeginConnect starts.

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

Copy link

codecov bot commented Apr 3, 2024

Codecov Report

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

Project coverage is 54.81%. Comparing base (33df292) to head (be51c38).

Files Patch % Lines
...pc.Ua.Core/Stack/Tcp/UaSCBinaryTransportChannel.cs 25.00% 2 Missing and 1 partial ⚠️
Stack/Opc.Ua.Core/Stack/Client/ClientBase.cs 75.00% 1 Missing ⚠️
...ack/Opc.Ua.Core/Stack/Tcp/ChannelAsyncOperation.cs 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2577      +/-   ##
==========================================
+ Coverage   54.64%   54.81%   +0.16%     
==========================================
  Files         343      343              
  Lines       65215    65225      +10     
  Branches    13352    13354       +2     
==========================================
+ Hits        35639    35753     +114     
+ Misses      25697    25609      -88     
+ Partials     3879     3863      -16     

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

{
Utils.LogTrace("ChannelId {0}: in {1} state.", ChannelId, value);
Utils.LogInfo("ChannelId {0}: in {1} state.", ChannelId, value);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

should remain Trace

@KircMax
Copy link
Contributor

KircMax commented Apr 16, 2024

Is this 'ready to be tried out'?
If so can I somehow get a pre-release of a NuGet Package to do so?

@romanett
Copy link
Contributor

Is this 'ready to be tried out'? If so can I somehow get a pre-release of a NuGet Package to do so?

preview nugets are available for every merge to master.

So for open PRs it is easiest to clone the branch and build a nuget locally (using dotnet pack).

@mregen
Copy link
Contributor Author

mregen commented Apr 17, 2024

Hi @KircMax, unfortunately this work isn't finished and I had to suspend for a bit. I let you know when it is ready for test.
Thanks for your help and interest in the topic.

@mregen mregen added this to the April Update milestone May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants