Can't stop & start timer pulse

Bug #1547029 reported by Endre Karlson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.service
Expired
Undecided
Unassigned

Bug Description

import logging
import random

logging.basicConfig(level="DEBUG")

from oslo_config import cfg
from oslo_service import service
from oslo_service import threadgroup

def print_rand():
    print(random.random())

class Svc(service.Service):
    def __init__(self, *args, **kwargs):
        super(Svc, self).__init__(*args, **kwargs)

        self.pulse = self.tg.add_timer(0.5, print_rand)
        self.pulse.stop()
        self.pulse.start(1)

svc = Svc()
svc.start()

service.launch(cfg.CONF, svc).wait()

Revision history for this message
Endre Karlson (endre-karlson) wrote :

venv)karlsone@karlsone:~/projects/dnsaas/designate$ python test.py
Traceback (most recent call last):
  File "test.py", line 25, in <module>
    svc = Svc()
  File "test.py", line 22, in __init__
    self.pulse.start(1)
  File "/home/karlsone/projects/dnsaas/designate/.venv/local/lib/python2.7/site-packages/oslo_service/loopingcall.py", line 180, in start
    stop_on_exception=stop_on_exception)
  File "/home/karlsone/projects/dnsaas/designate/.venv/local/lib/python2.7/site-packages/oslo_service/loopingcall.py", line 115, in _start
    raise RuntimeError(self._RUN_ONLY_ONE_MESSAGE)
RuntimeError: A fixed interval looping call can only run one function at a time

Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :
Changed in oslo.service:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for oslo.service because there has been no activity for 60 days.]

Changed in oslo.service:
status: Incomplete → Expired
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on oslo.service (master)

Change abandoned by Yossi Ovadia (<email address hidden>) on branch: master
Review: https://review.openstack.org/629289
Reason: after alot of research, this fix does not fix the initial neutron reported issue.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.