You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have an application based your OPC UA Stack (it implements the ApplicationIf() and populates the address space) and we noticed after running the server for extensive amount of time that the OpcUaServer3 process keeps opening TCP connections for some reason. You can see it by running the following call in Linux:
After some time you will see that the number of TCP connections keeps growing. This leads in extreme case to TCP connection error "Too many open files" during address resolving.
From what we see, it seems that the method DiscoveryClientRegisteredServers::loop() at [ASNeG]/OpcUaStack/src/OpcUaStackClient/ApplicationUtility/DiscoveryClientRegisteredServers.cpp:156 is what is causing this problem.
From running the debugger we can see sessionService_->secureChannelState() is always SessionService::SecureChannelState::SCS_Disconnected and the state of OpcUaStackCore::SecureChannel is always OpcUaStackCore::SecureChannel::State::S_Reconnecting
It seems that DiscoveryClientRegisteredServers::loop() does not keep track of the open TCP connections it called for previously and simply tries to open a new connection without handling the old connections.
Could you look into this and let us know if this is an actual problem with the stack?
Reason
The discovery process is repeated every 40 seconds. If successful, the OPC UA client opens an OPC UA connection to the discovery server, sends a discovery request to the discovery server and closes the connection.
If a connection to the Discovery Server can not be established, the connection is not deleted and a new connection is opened after 40 seconds.
Solution 1:
The Discovery server is mostly not used. For this reason, the Discovery Server can be removed from the configuration.
Hi @huebl ,
We have an application based your OPC UA Stack (it implements the
ApplicationIf()
and populates the address space) and we noticed after running the server for extensive amount of time that the OpcUaServer3 process keeps opening TCP connections for some reason. You can see it by running the following call in Linux:watch -n1 lsof -p $(ps aux | grep "OpcUa" | grep -v grep | awk '{print $2}')
After some time you will see that the number of TCP connections keeps growing. This leads in extreme case to TCP connection error "Too many open files" during address resolving.
From what we see, it seems that the method
DiscoveryClientRegisteredServers::loop()
at[ASNeG]/OpcUaStack/src/OpcUaStackClient/ApplicationUtility/DiscoveryClientRegisteredServers.cpp:156
is what is causing this problem.From running the debugger we can see
sessionService_->secureChannelState()
is alwaysSessionService::SecureChannelState::SCS_Disconnected
and the state ofOpcUaStackCore::SecureChannel
is alwaysOpcUaStackCore::SecureChannel::State::S_Reconnecting
It seems that
DiscoveryClientRegisteredServers::loop()
does not keep track of the open TCP connections it called for previously and simply tries to open a new connection without handling the old connections.Could you look into this and let us know if this is an actual problem with the stack?
Setup information:
The text was updated successfully, but these errors were encountered: