-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Monitored items and UA_VARIANT_DATA_NODELETE #6512
Comments
That is strange. what could happen is that we keep the original variant around for the comparison. |
…d memory location Test a hypothesis for open62541#6512.
Added a unit test for this in #6518. |
…d memory location Test a hypothesis for #6512.
This is indeed very strange... I have added debug output to
and according to this output, the data pointer is indeed identical for the old and new variants:
EDIT: My callback sets the server timestamp in the DataValue and I can get it working if I modify the monitored item in UaExpert to trigger on StatusValueTimestamp. Could this also be the reason why your test works? EDIT 2:
|
I have found the cause of the problem: My callback didn't set hasValue in the DataValue which caused a shallow copy of the DataValue being made in This is quite surprising to me because I remember that the |
_NODELETE can still be used for zero-copy reads. But you make a good point. |
@jpfr If I understand the current implementation correctly, a deep copy is always made directly after the data source read callback is called. |
Yeah. We had issues when keeping around _NODELETE variables after releasing the node in the nodestore. What we can do is: Delay the node _release until after the MonitoredItem is fully processed. |
When a data source read callback sets the storage type of the
UA_Variant
toUA_VARIANT_DATA_NODELETE
and the data pointer refers to a fixed memory position (e.g. static variable), any monitored item for a variable node with such a data source callback doesn't detect any data changes.If I remember correctly, there were changes to the behavior of variant copying with
UA_VARIANT_DATA_NODELETE
some time ago. Would these changes explain the observed behavior and if so, is there a way to deal with it?Checklist
Please provide the following information:
The text was updated successfully, but these errors were encountered: