Merge "Retry status updates to Octavia" into stable/victoria

This commit is contained in:
Zuul 2021-01-07 10:11:42 +00:00 committed by Gerrit Code Review
commit 7a4fa0d132
1 changed files with 21 additions and 15 deletions

View File

@ -291,18 +291,24 @@ class OvnProviderHelper(object):
def request_handler(self):
while True:
try:
request = self.requests.get()
request_type = request['type']
if request_type == ovn_const.REQ_TYPE_EXIT:
break
request = self.requests.get()
request_type = request['type']
if request_type == ovn_const.REQ_TYPE_EXIT:
break
request_handler = self._lb_request_func_maps.get(request_type)
request_handler = self._lb_request_func_maps.get(request_type)
try:
if request_handler:
status = request_handler(request['info'])
if status:
self._update_status_to_octavia(status)
self.requests.task_done()
except driver_exceptions.UpdateStatusError as e:
msg = ("Error while updating the load balancer "
"status: %s") % e.fault_string
LOG.error(msg)
# TODO(haleyb): The resource(s) we were updating status for
# should be cleaned-up
except Exception:
# If any unexpected exception happens we don't want the
# notify_loop to exit.
@ -311,16 +317,16 @@ class OvnProviderHelper(object):
def add_request(self, req):
self.requests.put(req)
@tenacity.retry(
retry=tenacity.retry_if_exception_type(
driver_exceptions.UpdateStatusError),
wait=tenacity.wait_exponential(),
stop=tenacity.stop_after_delay(10),
reraise=True)
def _update_status_to_octavia(self, status):
try:
status = OvnProviderHelper._delete_disabled_from_status(status)
LOG.debug('Updating status to octavia: %s', status)
self._octavia_driver_lib.update_loadbalancer_status(status)
except driver_exceptions.UpdateStatusError as e:
msg = ("Error while updating the load balancer "
"status: %s") % e.fault_string
LOG.error(msg)
raise driver_exceptions.UpdateStatusError(msg)
status = OvnProviderHelper._delete_disabled_from_status(status)
LOG.debug('Updating status to octavia: %s', status)
self._octavia_driver_lib.update_loadbalancer_status(status)
@tenacity.retry(
retry=tenacity.retry_if_exception_type(idlutils.RowNotFound),