]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Initialize dist_fip_count after agent restart
authorMichael Smith <michael.smith6@hp.com>
Wed, 10 Sep 2014 23:59:14 +0000 (16:59 -0700)
committerMichael Smith <michael.smith6@hp.com>
Thu, 22 Jan 2015 00:02:02 +0000 (16:02 -0800)
commitee4bae211309e0f1fcee5565ddd2379997e1de13
tree9419318b1d4f0e95b06d48c8bc3ff4bd7b337c42
parent46161134f8d90229cef1aaf2c0f8a403c1ba58e8
Initialize dist_fip_count after agent restart

Runtime router variable dist_fip_count has been
used to keep track of FIPs for DVR routers.
This variable is not re-initialized correctly on
agent restart and can get stale from other errors
which cause problems with namespace and port cleanup.

This patch will initialize the ri.dist_fip_count
once in process_router for dvr routers only.  This
method was selected instead of the _router_added or
_router_removed path because it is the one central
entry point for rotuer add, delete, and update.

The object self.agent_gateway_port also needs to be
properly handled after an agent restart and this
patch will handle that as well.

When needed, the system will be read via system
calls to determine the state of namespaces and ports
since the variables cannot be relied on.
System calls will be kept to a minimum to reduce
and possible performance hits.

Change-Id: Iae5ebf5249f8e16ab57df78e042293ca2855ddf1
Closes-bug: #1367039
neutron/agent/l3/agent.py
neutron/agent/l3/dvr.py
neutron/agent/l3/dvr_router.py
neutron/tests/unit/test_l3_agent.py