FixedIntervalLoopingCall dies after runs several times in cinder/openstack/common/threadgroup#ThreadGroup

Bug #1362456 reported by Jerry Cai
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
New
Undecided
Unassigned

Bug Description

In latest Cinder component, we used ThreadGroup in cinder/openstack/common/threadgroup to add a timer, but it dead after run 1-2 times, the thread is alive but always hang there.

This is the code piece of threadgroup.py:
    def add_timer(self, interval, callback, initial_delay=None,
                  *args, **kwargs):
        pulse = loopingcall.FixedIntervalLoopingCall(callback, *args, **kwargs)
        pulse.start(interval=interval,
                    initial_delay=initial_delay)
        self.timers.append(pulse)

#What we did is create a manager:
from cinder.openstack.common import service
class MyManager(service.Service):
....
    def __init__(self):
        self.test_periodic_task()

    #add a timer
    def test_periodic_task(self):
        def test():
            LOG.error('print!')

        LOG.error('Start to print!')
        self.tg.add_timer(5, test)

The result is "print" printed twice but after that the thread is hang there, no log any more. We also tried open the backdoor_port in cinder.conf and tried to check the GreenThread status but failed to telnet on it, seems the thread is not in response.

The codes work on previous release but failed in latest cinder component, hope the members who has insight can check on this.

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.