events errors with tangotest or any device server
I have a problem with a device server that I developed in c ++ and is using events.
I am using the push_event () method with a callback activated for each new value of a scalar attribute.
I actually have two problems:
1) the callback is unnecessarily activated by an erroneous event.
2) the callback is activated with an identical event value
These two problems occures more often than the polling is fast on the subscribed attribute …
To try to understand how events work, I reproduce the same problems with a python client which subscribes an event on the 'short_scalar' attribute of tangotest.
The 'short_scalar' attribute is configured as follows:
polling: below 50ms
event: absolute and relative 0.1
Can someone tell me if this is normal?
Thanks a lot for your help.
I add that, the faster the value of the polling on the attribute, the more the callback is activated.
And, about my environment:
You're facing the well known "Polling thread is late" problem.
You should follow the advice in the error description : Advice: Tune device server polling
This is expected behaviour if your polling thread cannot do the job as expected.
If your attribute polling period is set to a too small value, the polling thread which is in charge of reading the polled attribute will sometimes not be able to keep up and to respect the configured polling period.
When this happens, the Tango polling thread is not able to read the attribute in the expected configured period and might skip reading some attributes sometimes.
When this happens, Tango informs the clients who subscribed to events on the concerned attributes with the error you're seeing:
The polling thread is late and discard this object polling.
Advice: Tune device server polling
This is expected behaviour.
Then the next time the polling manages to read the attribute again, it sends a new event with the read value.
Since the previous event sent was an error event, Tango considers that the situation changed for this attribute and that it should send an event.
The callback is not activated with an identical value as your were writing.
Tango considers that the value changed because there was an error event, followed by a correct event. The content of the events data is different (once there was an error and then there was a correct value. So there is a change to be notified to the client).
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new.