The periodic_task decorator for the sync routers task was resulting
in a default spacing of 60 seconds. This meant that any values less
than that for the periodic_interval setting would not work correctly.
The fixed interval looping call would run at the periodic_interval
but this task would not execute every time as expected.
For example, if the periodic_interval was 40 seconds, the task would
only end up running every other interval (80 seconds in this case)
because every other attempt would be blocked by the default 60 second
barrier of periodic_task.
This sets the periodic_taks spacing variable to 1 second so the
interval is controlled only by the loopingcall as expected.
Ultimately periodic_task should probably be completely removed since
it's not compatible with the fixed interval loopingcall in this manner.
Closes-Bug: #
1411085
Change-Id: I23818c3fab2640b241692f00f9b5a2f923e3cf31
while True:
pool.spawn_n(self._process_router_update)
- @periodic_task.periodic_task
+ # NOTE(kevinbenton): this is set to 1 second because the actual interval
+ # is controlled by a FixedIntervalLoopingCall in neutron/service.py that
+ # is responsible for task execution.
+ @periodic_task.periodic_task(spacing=1)
def periodic_sync_routers_task(self, context):
self.process_services_sync(context)
LOG.debug("Starting periodic_sync_routers_task - fullsync:%s",