Browse Source

Merge "[L3][HA] Retry when setting HA router GW status." into stable/train

changes/41/770741/3
Zuul 5 months ago
committed by Gerrit Code Review
parent
commit
77d6ab54e9
  1. 7
      neutron/agent/l3/ha_router.py
  2. 12
      neutron/agent/linux/interface.py

7
neutron/agent/l3/ha_router.py

@ -547,8 +547,11 @@ class HaRouter(router.RouterInfo):
if ex_gw_port_id:
interface_name = self.get_external_device_name(ex_gw_port_id)
ns_name = self.get_gw_ns_name()
self.driver.set_link_status(interface_name, ns_name,
link_up=link_up)
if (not self.driver.set_link_status(
interface_name, namespace=ns_name, link_up=link_up) and
link_up):
LOG.error('Gateway interface for router %s was not set up; '
'router will not work properly', self.router_id)
if link_up and set_gw:
preserve_ips = self.get_router_preserve_ips()
self._external_gateway_settings(ex_gw_port, interface_name,

12
neutron/agent/linux/interface.py

@ -323,14 +323,20 @@ class LinuxInterfaceDriver(object):
def set_link_status(self, device_name, namespace=None, link_up=True):
ns_dev = ip_lib.IPWrapper(namespace=namespace).device(device_name)
if not ns_dev.exists():
LOG.debug("Device %s may concurrently be deleted.", device_name)
return
try:
utils.wait_until_true(ns_dev.exists, timeout=3)
except utils.WaitTimeout:
LOG.debug('Device %s may have been deleted concurrently',
device_name)
return False
if link_up:
ns_dev.link.set_up()
else:
ns_dev.link.set_down()
return True
class NullDriver(LinuxInterfaceDriver):
def plug_new(self, network_id, port_id, device_name, mac_address,

Loading…
Cancel
Save