Fix enum undef ts bug35#43
Conversation
…in file. This isn't really necessary, but it makes for a cleaner visual diff against the github master branch.
ef931b8 to
12002c9
Compare
|
This pull request fails the tests on all different architectures. Please either fix the changes or the test. |
…bscription changes.
|
Looks like the test just needed to adjust the expected eventsReceived counts. |
|
Thanks a lot, Bruce! |
|
Is something blocking a merge of this pull request?
I clearly don't understand the details, but this seems related to #56: A client subscribes to the DBR_TIME_... variant of an array (double[] in this case). The array changes size; at times it turns into an empty array, zero elements. The client receives the array with its changing size via the gateway without problems. Then the client adds a DBE_PROPERTY subscription to DBR_CTRL_... to learn about changes in units, limits etc. With full logging enabled, the gateway will print Type 34 is the control-double type, so this rhymes with "When support for propEventCB was added to the gateway, it subscribed to DBR_CTRL_*". The underlying problem seems to be that the gateway maintains one cached copy of the data for the channel. It starts as a DBR_TIME_.. subscription for the value. As the client then asks for a DBE_PROPERTY subscription to DBR_CTRL_.., the data type of the gateway PV is updated to "highestGddAppType" DBR_CTRL_..., but there's a problem with both the value and the property subscription updating the same PV data, turning the empty array into '0'. "This fix creates (separate) subscriptions for DBE_PROPERTY, .. one DBR_CTRL* ...and a DBR_TIME* subscription" seems to be a step in the right direction, alas when I try this PR, it doesn't fix #56 |
|
I will try to run the tests using this PR. (Test failures were my original concern.) |
|
General remark: |
|
Turns out this enum time stamp issue, while it mentions DBE_PROPERTY, is unrelated to the issue with empty arrays and a DBE_PROPERTY subscription to DBR_CTRL, #56 The issue I see is solely related to the handling of DBE_PROPERTY subscriptions, regardless of DBE_.. mask. Some "if (count <= 0)` code simply failed to handle array element counts of zero. Created separate PR for the empty array issue |
When support for propEventCB was added to the gateway, it subscribed to DBR_CTRL_* but calls both runDataCB and runValueDataCB. Since the DBR_CTRL_* events have zero in the timestamp fields and the value_data_callbacks assign the gdd from the DBR_CTRL* event to the gatePv value gdd, it can step on the timestamp from the DBR_TIME_* event.
I suspect the code in gatePvData::propEventCB was ignoring the first propEvent to avoid this bug but some cases get through and set the timestamp fields to zero, in particular mbbi and mbbo records.
This fix creates to subcriptions for DBE_PROPERTY events, one DBR_CTRL* subscription w/ propDataCB, and a DBR_TIME* subscription w/ propEventCB.