taurus-org / taurus

Moved to https://gitlab.com/taurus-org/taurus
http://taurus-scada.org
43 stars 46 forks source link

Polling starts only on the first call to addListener #1113

Closed reszelaz closed 4 years ago

reszelaz commented 4 years ago

This can be reproduced with:

import taurus

def cb(*args):
    pass

# or any other attribute which does not push events
a = taurus.Attribute("sys/tg_test/1/long_scalar")
a.addListener(cb)
a.removeListener(cb)
a.addListener(cb)

Here we don't get updates on the attribute anymore but we get every 10 s the following message:

Dummy-310 INFO 2020-05-20 17:15:07,361 pc255.cells.es:10000.tg_test.long_scalar: Activating polling. Reason: API_AttributePollingNotStarted

Changing this line: https://github.com/taurus-org/taurus/blob/89219e47480780551878b8434e98ec9f6da88ee9/lib/taurus/core/tango/tangoattribute.py#L749

to: self._deactivatePolling() helps.

cpascual commented 4 years ago

Hi @reszelaz , I reviewed the issue and I created a PR (#1113) following your hint. Feel free to integrate (you or any other @taurus-org/integrators )

reszelaz commented 4 years ago

Thanks for working on this topic. I won't have time to review it, sorry. When suggesting this change I saw with the git blame that it was recently introduced by Carlos F to avoid some other deadlock. Just mentioning it so we don't fall into a regression.