Skip to content

WIP: Usubscribe from events on the next subscription (PyTango#292)

Similarly to #1091 and #1093, this PR tries to workaround https://github.com/tango-controls/pytango/issues/292.

I tried this PR with sardana-org/sardana#1312 ( which reverts the Sardana workaround and use zombie concept in tests) and it works corrrectly for the sardanatestsuite and for the stress macro posted in https://github.com/taurus-org/taurus/pull/1093#issuecomment-602042643. So, IMO it is a satisfactory workaround.

Note that it has one side effect - it keeps garbage collected attributes subscribed until some new attribute is subscribed. To mitigate this effect attributes are marked as zombies - their push event return immediately. Also this should happen only for the configuration events - the change events should be unsubscribed with the last TaurusModel.removeListener call. Also if one wants to increase the frequency of unsubscribes the tangoattribute._empty_unsub_queue() could be called more frequently.

Merge request reports