Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Reconnection Mechanism Stucks on 4.2.0 after TCPConnection close request
October 8, 2024
10:30, EEST
Avatar
SerkanSahin
Member
Members
Forum Posts: 3
Member Since:
January 17, 2019
sp_UserOfflineSmall Offline

Hi,

We are using Java version 4.2.0-955 build.

There had been a network issue on our customer’s network where they had 7 different OpcUa servers and all the connections were stable and healthy. We create unique UaClient for each connection. After the network loss 6 of the clients were successfully able to reconnect to their respective OpcUa servers via auto reconnect, but 1 of the UaClient couldnt recover.

When we check the logs of UaClient for the problematic one, it was as below;

————-
2024-09-20 17:16:12,776 PublishTask-com.prosysopc.ua.client.UaClient@6e789e87 | c.p.u.s.t.t.i.TcpConnection | sendRequest: token=SecurityToken(Id=2, secureChannelId=-757636602, creationTime=Sep 20, 2024 5:16:12 PM, lifetime=3600000)
2024-09-20 17:16:12,776 PublishTask-com.prosysopc.ua.client.UaClient@6e789e87 | c.p.u.s.t.t.i.TcpConnection | sendRequest: keySize=0
2024-09-20 17:16:12,776 PublishTask-com.prosysopc.ua.client.UaClient@6e789e87 | c.p.u.s.t.t.i.ChunkFactory | ChunkFactory: class=class com.prosysopc.ua.stack.transport.tcp.impl.ChunkFactory
2024-09-20 17:16:12,777 PublishTask-com.prosysopc.ua.client.UaClient@6e789e87 | c.p.u.s.t.t.i.ChunkFactory | allocate: chunkSize=57
2024-09-20 17:16:12,777 PublishTask-com.prosysopc.ua.client.UaClient@6e789e87 | c.p.u.s.t.t.i.SecureChannelTcp | serviceRequest: Message sent, requestId=288 secureChannelId=-757636602
2024-09-20 17:16:12,777 PublishTask-com.prosysopc.ua.client.UaClient@6e789e87 | c.p.u.s.t.t.i.SecureChannelTcp | serviceRequest: message=CloseSecureChannelRequest [RequestHeader=”null”]
2024-09-20 17:16:12,777 PublishTask-com.prosysopc.ua.client.UaClient@6e789e87 | c.p.u.s.t.t.i.SecureChannelTcp | -757636602 Closed
2024-09-20 17:16:12,779 TcpConnection/Read | c.p.u.s.t.t.i.TcpConnection | /10.251.190.23:4840 Closed (expected)
2024-09-20 17:16:12,779 PublishTask-com.prosysopc.ua.client.UaClient@6e789e87 | c.p.u.s.t.t.i.TcpConnection | /10.251.190.23:4840 Closed
————-

It all ended over here and we dont receive any messages, exceptions from this UaClient anymore. It is as if it got stuck on some lock or something like that on SecureChannelTcp.

To give a successful example from one of the other 6, please check below logs;

————
2024-09-20 17:16:12,865 PublishTask-com.prosysopc.ua.client.UaClient@1ccaf4b4 | c.p.u.s.t.t.i.TcpConnection | pruneInvalidTokens: tokens(2)=[SecurityToken(Id=1, secureChannelId=-209045690, creationTime=Sep 20, 2024 4:30:52 PM, lifetime=3600000), SecurityToken(Id=2, secureChannelId=-209045690, creationTime=Sep 20, 2024 5:15:52 PM, lifetime=3600000)]
2024-09-20 17:16:12,865 PublishTask-com.prosysopc.ua.client.UaClient@1ccaf4b4 | c.p.u.s.t.t.i.TcpConnection | tokens=[SecurityToken(Id=1, secureChannelId=-209045690, creationTime=Sep 20, 2024 4:30:52 PM, lifetime=3600000), SecurityToken(Id=2, secureChannelId=-209045690, creationTime=Sep 20, 2024 5:15:52 PM, lifetime=3600000)]
2024-09-20 17:16:12,865 PublishTask-com.prosysopc.ua.client.UaClient@1ccaf4b4 | c.p.u.s.t.t.i.TcpConnection | getSecurityTokenToUse=SecurityToken(Id=2, secureChannelId=-209045690, creationTime=Sep 20, 2024 5:15:52 PM, lifetime=3600000)
2024-09-20 17:16:12,865 PublishTask-com.prosysopc.ua.client.UaClient@1ccaf4b4 | c.p.u.s.t.t.i.TcpConnection | sendRequest: token=SecurityToken(Id=2, secureChannelId=-209045690, creationTime=Sep 20, 2024 5:15:52 PM, lifetime=3600000)
2024-09-20 17:16:12,865 PublishTask-com.prosysopc.ua.client.UaClient@1ccaf4b4 | c.p.u.s.t.t.i.TcpConnection | sendRequest: keySize=0
2024-09-20 17:16:12,865 PublishTask-com.prosysopc.ua.client.UaClient@1ccaf4b4 | c.p.u.s.t.t.i.ChunkFactory | ChunkFactory: class=class com.prosysopc.ua.stack.transport.tcp.impl.ChunkFactory
2024-09-20 17:16:12,865 PublishTask-com.prosysopc.ua.client.UaClient@1ccaf4b4 | c.p.u.s.t.t.i.ChunkFactory | allocate: chunkSize=57
2024-09-20 17:16:12,866 PublishTask-com.prosysopc.ua.client.UaClient@1ccaf4b4 | c.p.u.s.t.t.i.SecureChannelTcp | serviceRequest: Message sent, requestId=295 secureChannelId=-209045690
2024-09-20 17:16:12,866 PublishTask-com.prosysopc.ua.client.UaClient@1ccaf4b4 | c.p.u.s.t.t.i.SecureChannelTcp | serviceRequest: message=CloseSecureChannelRequest [RequestHeader=”null”]
2024-09-20 17:16:12,866 PublishTask-com.prosysopc.ua.client.UaClient@1ccaf4b4 | c.p.u.s.t.t.i.SecureChannelTcp | -209045690 Closed
2024-09-20 17:16:12,866 TcpConnection/Read | c.p.u.s.t.t.i.TcpConnection | /10.251.190.21:4840 Closed (expected)
2024-09-20 17:16:12,867 PublishTask-com.prosysopc.ua.client.UaClient@1ccaf4b4 | c.p.u.s.t.t.i.TcpConnection | /10.251.190.21:4840 Closed
2024-09-20 17:16:12,867 PublishTask-com.prosysopc.ua.client.UaClient@1ccaf4b4 | c.p.u.s.t.t.i.SecureChannelTcp | requests.clear()
2024-09-20 17:16:12,870 PublishTask-com.prosysopc.ua.client.UaClient@1ccaf4b4 | c.p.u.s.t.t.i.SecureChannelTcp | initialize: url=opc.tcp://10.251.190.21:4840
————

and it goes and succeeds afterwards to recover.

As we have seen, for the problematic one we never get to the requests.clear() step and something between that and the previous log has to be causing the issue on the other one.

Can you please help us solve this issue as its quite crucial for us to address that. If the proposal is going to be updating the Java client version to 5.x.x, can you also please provide more information on what that suggestion depends on.

Thanks.

October 8, 2024
11:56, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1017
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

4.2.0 is almost 5 years old at this point. There has been numerous versions and fixes since. It would be recommended to update to 5.x, since that one receives fixes and updates. We do not typically debug old versions. If the latest 5.x has the issue, then any fixes we would do would be on top of that version.

For example, in 4.11.0 (https://downloads.prosysopc.com/opcua/Prosys_OPC_UA_SDK_for_Java_4_Release_Notes.html#version-4-11-0) there was a “Fixed: java.lang.Error: Maximum permit count exceeded due to multithreading race condition when the secure channel was closing.”, that could possibly be related to this (the fix was in the SecureChannelTcp class).

If you cannot immediately update to 5.x, could you please try at least with 4.11.0?

October 8, 2024
12:32, EEST
Avatar
SerkanSahin
Member
Members
Forum Posts: 3
Member Since:
January 17, 2019
sp_UserOfflineSmall Offline

Thanks Bjarne; yes, it feels to be the fix you are pointing. Let us try to update to 4.11.0 in first step then hopefully that resolves it.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 1919

Currently Online:
18 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Heikki Tahvanainen: 402

hbrackel: 144

rocket science: 86

pramanj: 86

Francesco Zambon: 83

Ibrahim: 78

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

Member Stats:

Guest Posters: 0

Members: 734

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1510

Posts: 6399

Newest Members:

tammyhillier, rodsFioravanti, Sairamreddy, wj, valentinafluhart, accusneds, Jamesses, DavidLarry, elainesever, powhephenry

Moderators: Jouni Aro: 1019, Pyry: 1, Petri: 0, Bjarne Boström: 1017, Jimmy Ni: 26, Matti Siponen: 340, Lusetti: 0

Administrators: admin: 1