Taurus may emit events with outdated data (Tango scheme)
In the Tango scheme there are three occassions that that may update the attribute ( __attr_value, __attr_err, __attr_timestamp). These methods are:
- read (executed in the main thread)
- push_event (executed in the Tango event consumer thread)
- poll (executed in the Taurus polling thread)
The last two of them emit Taurus events.
Current implementation may lead to emitting events with the outdated values. The polling mechanism reads the Tango attributes asynchronously (first drop the read requests and later on collect the replies). The more up to date event value may get overriden by an older value corresponding to the polling request dropped prior to the event reception.
We have observed that in a particular GUI with a lot of attributes being polled. One of the polled attributes was receiving events at the same time. The TaurusLabel with that attribute was changing to the value corresponding to the event, but suddently returing to show the previous value. After approx. 3 seconds the label refreshed correctly.
I propose to treat the manipulation of attribute members ( __attr_value, __attr_err, __attr_timestamp) as a critical section and protect access to it with a lock. Furthermore the update should be discarded if the value present in the attibute is more up to date.
Reported by: reszelaz ( http://sf.net/u/zreszela )