[openstack-dev] The periodic task on openstack
Jiang, Yunhong
yunhong.jiang at intel.com
Fri Nov 16 08:34:24 UTC 2012
A follow-up for your discussion on IRC last night, I had a quick check of the loopingcall implementation, and seems there is really no time gurantee. Even if we adjust the interval for greenthread.sleep() dynamically, we also must make the metering periodic task always at the head.
I think we can enhance the periodic task to meet partially our requirement, like create a separated task type as high-priority, which should make sure no long-delay.
The only concern is, can we make sure the LoopingCall itself will be invoked on time after the greenthread.sleep(interval), considering the attribute of greenthread, or even python thread.
openstack/common/loopingcall.py-> LoopingCall(object):
while self._running:
self.f(*self.args, **self.kw)
if not self._running:
break
greenthread.sleep(interval)
Thanks
--jyh
More information about the OpenStack-dev
mailing list