[openstack-dev] [Nova][Olso] Periodic task coalescing
mriedem at linux.vnet.ibm.com
Thu Jun 12 15:42:04 UTC 2014
On 6/12/2014 8:55 AM, Tom Cammann wrote:
> 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)
> 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?
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
Seems reasonable to remove this. For historical context, it looks like
this code was moved over to oslo-incubator from nova in early Havana
. 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 .
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.
More information about the OpenStack-dev