Please consider registering

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
subscription lost after communication fault
February 19, 2021
11:36, EET
Forum Posts: 71
Member Since:
August 20, 2014
sp_UserOfflineSmall Offline

we are using ua-client-server-sdk-4.0.2-808.
Our client application for unknown reasons does no longer receive datachange events after a communikation fault. If we recignize a communication fault we renew all subscriptions, but still it can sometimes happen, that we dont receive changes any more. Our session to the server is still active, because we can still read and write, only the data change subscription is gone. We also analysed the server when we are in that state with UaExpert. We could see that in the servers sessions diagnostics we can find our session, but the subscription is emtpy. We dont understand how we can come into this state. Could you please support us what we can do to find out what is the root cause for this?

Thanks in advance.


February 19, 2021
12:21, EET
Bjarne Boström
Forum Posts: 620
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline


Is the server made with our SDK or something else?

Please be a bit more specific with what you mean with “renew all subscriptions”? With defaults, the SDK would do that automatically (to a degree). If you are doing that in addition manually, the id’s that define the items might get mixed etc.

I would assume you let the SDK handle the reconnecting (this is the default) and are not manually calling UaClient.reconnect(). In SDK 4.3.0 we added a WARN log if this is made (manual call while the automatic reconnecting is enabled). A better solution is hopefully made in the future.

Anyway, Subscriptions live independently from Sessions. While Subscriptions are made in a context of a Session, they can be transferred to another one. An active Session prevents subscriptions from timing out in the serve side by sending PublishRequests, which the server responds data or keepalives if nothing to send. If because of a connection break no publishrequest arrives within LifetimeCount*PublishInterval, the server will delete the Subscription.

If UaClient notices a communication break, it will go into a “reconnect mode”. Once connection resumes, if the old session cannot be used, it will make a new one and tries to transfer the Subscriptions to it. If that fails it will try to recreate them (if this fails, there is limited automatic error handling).

An SubscriptionAliveListener can be set to the client side subscriptions, it’s onTimeout and onLifetimeTimeout will be called by the SDK if a keepalive was not received when expected and when it can be expected that the server would have deleted the subscription, respectively. In general, both cases could be taken as an error scenario, that preferably should not happen. However, if the connection resumes before the lifetime runs out, then the onTimeout wont matter. Both calls are calculated on the client side based on the timings when we should have received a keepalive.

SDK currently cannot recover automatically from a scenario that if we do not detect a communication break (i.e. we keep getting the ServerStatus via Read), but the server would still fail to send us a keepalive or data. That could be detected with SubscriptionAliveListener, but I do recognize, that the situation is not optimal, since those would also get called eventually in a connection break scenario.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 267

Currently Online:
7 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 109

pramanj: 86

ibrahim: 71

kapsl: 57

gjevremovic: 49

TimK: 41

fred: 41

Fransua33: 39

Xavier: 34

Thomas Reuther: 33

Member Stats:

Guest Posters: 0

Members: 1221

Moderators: 15

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1089

Posts: 4591

Newest Members:

aravindj, Deniz.Turan, DenizT, igonzalez, lavonwinters963, felicapurdy9, shoshanastopford, UlrichFM, majaba, Yash_Joshi_Pratiti

Moderators: Jouni Aro: 865, Otso Palonen: 32, Tuomas Hiltunen: 5, janimakela: 0, Pyry: 1, Terho: 0, Petri: 0, Bjarne Boström: 620, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Teppo Uimonen: 21, Markus Johansson: 30, Matti Siponen: 92, Lusetti: 0

Administrators: admin: 1