Skip to content
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

Initial data change callback is sometimes not called #5226

Open
1 of 7 tasks
basyskom-jvoe opened this issue Jun 27, 2022 · 1 comment
Open
1 of 7 tasks

Initial data change callback is sometimes not called #5226

basyskom-jvoe opened this issue Jun 27, 2022 · 1 comment

Comments

@basyskom-jvoe
Copy link
Contributor

Description

Sometimes when creating a monitored item using the synchronous open62541 client API, the initial data change notification is dropped with the following message:

Could not process a notification with clienthandle 9 on subscription 4

The error message is printed in https://github.com/open62541/open62541/blob/1.3/src/client/ua_client_subscriptions.c#L917 and indicates that the client's monitored item context has not yet been inserted into the list when the notification arrives.

The issue occurs with open62541 1.2 and 1.3, the server is also based on open62541 (same version).

Checklist

Please provide the following information:

  • open62541 Version (release number or git tag): v1.3.1
  • Other OPC UA SDKs used (client or server):
  • Operating system: Ubuntu 18.04
  • Logs (with UA_LOGLEVEL set as low as necessary) attached
  • Wireshark network dump attached
  • Self-contained code example attached
  • Critical issue
@JulZimmermann
Copy link
Contributor

I have the same problem when creating monitored items via the async api.
I create monitored items dynamically while the application is running. UA_Client_run_iterate runs in a loop in an own thread.

The calls to UA_Client_Subscriptions_create_async, UA_Client_MonitoredItems_createDataChanges_async, and UA_Client_run_iterate are protected by a mutex.

I analyzed the network communication and it seems like the flow is the fallowing:

  1. CreateMonitoredItemsRequest is send by the client
  2. PublishRequest is send by the client
  3. PublishResponse is send by the server, already containing the initial values of the requested monitored items
  4. CreateMonitoredItemsResponse is send by the server

I'm not sure if the server is allowed to send the values inside the PublishResponse before sending the CreateMonitoredItemsResponse, or if the the OPCUA standard is violated by that. Anyway, the open62541 client lib can't handle this and will discard the values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants