Revert "[L3][HA] Retry when setting HA router GW status."

In short this patch can cause the privsep reader thread to
die resulting in the l3 agent getting stuck and e.g. not
processing any router updates. See related LP bug for full
explanation.

Closes-Bug: #1927868

This reverts commit 662f483120.

Change-Id: Ide7e9771d08eb623dd75941e425813d9b857b4c6
(cherry picked from commit 344fc0c8d2)
This commit is contained in:
Edward Hope-Morley 2021-08-20 12:25:04 +01:00 committed by Pierre Riteau
parent 9c255bc1a3
commit f54658c203
2 changed files with 5 additions and 14 deletions

View File

@ -536,11 +536,8 @@ 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()
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)
self.driver.set_link_status(interface_name, ns_name,
link_up=link_up)
if link_up and set_gw:
preserve_ips = self.get_router_preserve_ips()
self._external_gateway_settings(ex_gw_port, interface_name,

View File

@ -323,20 +323,14 @@ 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)
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 not ns_dev.exists():
LOG.debug("Device %s may concurrently be deleted.", device_name)
return
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,