[openstack-dev] [Nova][Olso] Periodic task coalescing

Matt Riedemann mriedem at linux.vnet.ibm.com
Thu Jun 12 15:42:04 UTC 2014

On 6/12/2014 8:55 AM, Tom Cammann wrote:
> Hello,
> I'm addressing https://bugs.launchpad.net/oslo/+bug/1326020 which is
> dealing with periodic tasks.
> There is currently a code block that checks if a task is 0.2 seconds
> away from being run and if so it run now instead. Essentially
> coalescing nearby tasks together.
>  From oslo-incubator/openstack/common/periodic_task.py:162
> # If a periodic task is _nearly_ due, then we'll run it early
> idle_for = min(idle_for, spacing)
> if last_run is not None:
>      delta = last_run + spacing - time.time()
>      if delta > 0.2:
>          idle_for = min(idle_for, delta)
>          continue
> However the resolution in the config for various periodic tasks is by
> the second, and I have been unable to find a task that has a
> millisecond resolution. I intend to get rid of this coalescing in this
> bug fix.
> It fits in with this bug fix as I intend to make the tasks run on their
> specific spacing boundaries, i.e. if spacing is 10 seconds, it will run
> at 17:30:10, 17:30:20, etc.
> Is there any reason to keep the coalescing of tasks?
> Thanks,
> Tom
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Seems reasonable to remove this.  For historical context, it looks like 
this code was moved over to oslo-incubator from nova in early Havana 
[1]. Going back to grizzly-eol on nova, the periodic task code was in 
nova.manager. From what I can tell, the 0.2 check was added here [2]. 
There isn't really an explicit statement about why that was added in the 
commit message or the related bug though. Maybe it had something to do 
with the tests or the dynamic looping call that was added?  You could 
see if Michael (mikal) remembers.

[1] https://review.openstack.org/#/c/25885/
[2] https://review.openstack.org/#/c/18618/



Matt Riedemann

More information about the OpenStack-dev mailing list