Replies: 3 comments 5 replies
-
What Server are you seeing this against? The Server should be protecting against this, in particular because this check is done after creating a Session but before activating the Session.
These Sessions are never activated and should either time out or be cycled out to make room for new Sessions automatically. |
Beta Was this translation helpful? Give feedback.
-
Looks like maybe the Milo Server implementation does not do this correctly either... |
Beta Was this translation helpful? Give feedback.
-
Also, just as general advice, you should not call You probably see many Client/Session created because you create a new Client each time and never shutdown or stop this Session FSM by calling disconnect(). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
When repeatedly attempting to connect to an OPC UA server with an invalid certificate, Milo appears to accumulate sessions. Once the certificate becomes valid again, the server reports many open sessions — as many as it can handle — as if all prior connection attempts were "queued up" until the certificate check passed.
This is a simplified snippet of the connection logic that is retriggered if it throws an error every 5 seconds:
When the server-side certificate flag is set to invalid, the call to client.connect() fails with:
org.eclipse.milo.opcua.stack.core.UaException: status=Bad_SecurityChecksFailed, description=An error occurred verifying security.
At some point during runtime we set the server-side certificate to a valid cert, the connection succeeds but the server now shows a large number of open sessions, as if every retry attempt resulted in a lingering session once the certificate became valid.
An easy fix for this is to keep a reference of the client and call the disconnect function in the catch block - I am not sure though if this is expected behavior, if our reconnect logic doesn't make sense or if this is an actual bug in the client implementation. Nevertheless I wanted to report it!
Additional context
Beta Was this translation helpful? Give feedback.
All reactions