Menu

#146 Polling continues for unlistened attribute

Jul15
resolved
None
bug
2015-03-30
2015-02-18
No

Looks like there's a regression in Taurus 3.4 regarding removing attributes from polling. Calling "removeListener" on an Attribute does not mean that the attribute is removed from polling, although it does mean the listener is no longer invoked. I believe the offending line is 111 in core/tauruspollingtimer.py, which should be

if attr_name in attr_dict:

instead of:

if attr_name not in attr_dict:

Close by in the same file I think there's another related bug that has been around longer, which means that a device that no longer has any polled attributes is still polled for an empty list of attributes, which does not seem to make any sense. Adding the following to the aformentioned "if" statement:

   if not attr_dict:
       del self.dev_dict[dev]

appears to solve the issue. Note that I've just tested this a little bit myself, so it may have other consequences I'm missing.

Discussion

  • Carlos Pascual

    Carlos Pascual - 2015-02-19

    Your analysis seems (at first sight) ok to me.
    I can make a patch for it, but if you already have it done, please send the patch to the list and I can review it.

     
  • Johan Forsberg

    Johan Forsberg - 2015-02-20

    Sure, here's the patch. Thanks for taking a look!

     
  • Carlos Pascual

    Carlos Pascual - 2015-02-23

    Your patch has been pushed to the develop branch.

    Thanks for reporting and contributing!

     
  • Carlos Pascual

    Carlos Pascual - 2015-02-23
    • assigned_to: Carlos Pascual
    • Milestone: unassigned --> Jul15
     
  • Carlos Pascual

    Carlos Pascual - 2015-02-23
    • status: waiting --> resolved
     
  • Tiago Coutinho

    Tiago Coutinho - 2015-03-30

    Ticket moved from /p/sardana/tickets/331/

    Can't be converted:

    • _category: taurus