From: Kevin Benton Date: Thu, 15 Jan 2015 16:11:49 +0000 (-0800) Subject: Make L3 agent honor periodic_interval setting X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=8c989e67b99745f55d462e21be0eaa00f6a0e9b8;p=openstack-build%2Fneutron-build.git Make L3 agent honor periodic_interval setting 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 --- diff --git a/neutron/agent/l3/agent.py b/neutron/agent/l3/agent.py index 3c754d46e..99d3cf102 100644 --- a/neutron/agent/l3/agent.py +++ b/neutron/agent/l3/agent.py @@ -475,7 +475,10 @@ class L3NATAgent(firewall_l3_agent.FWaaSL3AgentRpcCallback, 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",