NPP Put to a pp(TRUE) VAL field doesn't trigger monitors
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
EPICS Base |
Incomplete
|
Low
|
Andrew Johnson |
Bug Description
There is code in dbAccess.c::dbPut() that calls db_post_events() after writing to a field. This code is conditional, and explicitly avoids posting a monitor if the put was to the record's VAL field and that field is marked pp(TRUE); if the put came from a CA client the record is about to be processed anyway, so this conditional prevents 2 monitor events from being generated by the same put.
However if the put was actually from a DB link marked NPP, the above logic is wrong because the record is not about to be processed. This behavior is somewhat obscure, and does catch out database designers (it came up again at APS just today).
It is possible for the DB link to call db_post_events() itself in this case, but it isn't obvious whether it should or not. When I add the necessary code the result looks a bit strange because the record's VAL changes but the alarm state and timestamp do not. This could also conflict with the monitor deadband processing as this monitor will happen every time the put occurs and will not update the MLST field.
I will attach the necessary code changes to this bug report for the 3.16 branch; earlier branches would need it moving since the modifications are to the DB link type, and I don't think it should go in any earlier than 3.16 anyhow.
Opinions please, should this be applied or not?
The side effect is even worse for an archiver:
The archiving engine will either reject the value (because the timestamp is too old) or take the value, which creates wrong archived data (showing the new value as if it was set at the old timestamp).