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
Client will reopen secure channel with new ID without reactivating session #2538
Comments
It doesn't look to me like there is any mechanism to recover after a loss of connection at all? Presumably this happening hits here:
but there is no mechanism to communicate back to the client that the channel was reopened, from what I can tell, so the client would only be reactivated when using the |
I also added some Logs for the Client in the related #2544 that I created which is a duplicate of this one. |
Hi @mregen, thank you for getting back to us on this! How do you see the way forward here – and would you have any estimates or updates? |
If you could maybe point out some things where I could do some pre-work for you I'd like to try to help @mregen - currently I am on vacation but afterwards I'd happily try. |
Hi @einarmo, @KircMax, @audunmidttunsystad, I was able to reproduce the issue with the sysinternals tcpview tool, close the connection and I see it happening. Thanks for reporting this special case! I think currently of multiple ways to fix this: I think the latter option might be smoother if there is really just a small network interruption. Problem in both cases is that the reconnect handler must trigger a reconnect to get the Activate message sent and queued before the TCP BeginConnect starts. So better were the reconnect handler is immediately triggered when the socket closes, it may also need some additional wiring. Looking into the fix now... |
Hi @mregen Both ways seem like valid fixes to me - From my side I'd leave this up to you to decide, you clearly have more experience and knowledge of the codebase. |
Type of issue
Current Behavior
If the TCP connection is unexpectedly killed, the client will open a new secure channel with
SecureChannelId
0, but it will not follow that up withActivateSession
. From what I can tell this is in violation of the standard.What will eventually happen is that the new conection will fail, and the client will open another new secure channel where it will attempt to reactivate the session, this will only happen after keep alive timed out on the half-opened session.
Expected Behavior
The client should always reactivate sessions when creating a new secure channel before sending normal OPC UA requests on the new channel.
Steps To Reproduce
This is reproducible with a local server and a local client, including the sample client/server.
tcpkill
or a similar tool to sendRST
packets on the open connection, using the outgoing port for the client as the target, so that you only kill one connection, and not any subsequent connections the client creates.Environment
Anything else?
Here's a screenshot from wireshark:
Note how it takes several seconds after opening a new channel before the client discovers that the channel is bad and recreates it.
The text was updated successfully, but these errors were encountered: