Skip to content

Commit

Permalink
[status_manager] cleanup: Log request errors
Browse files Browse the repository at this point in the history
NoResultFound has to be catched seperately, because it inherits
InvalidRequestError (which makes absolutely no sense, but whatever)
  • Loading branch information
BenjaminLudwigSAP committed Aug 10, 2022
1 parent 9ba141e commit d0b6523
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions octavia_f5/controller/statusmanager/status_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,8 @@ def _get_lb_msg(lb_id):
member_id = member['description']
base_path = memberstats['selfLink'][:memberstats['selfLink'].find('/stats')]
member_path = '{}/{}/stats'.format(base_path, member['fullPath'].replace('/', '~'))
# this weirdness is to alleviate some race condition
# TODO: This weirdness is to alleviate some race condition(s).
# I don't know which one. See 99496ec74ab79e39bc206620a67fd64a1093d227
if member_path in memberstats['entries']:
statobj = memberstats['entries'][member_path]
elif member_path.replace('%', '%25') in memberstats['entries']:
Expand Down Expand Up @@ -398,7 +399,10 @@ def cleanup(self):
"""
with DatabaseLockSession() as session:
filters = {'load_balancer_id': None, 'cached_zone': None, 'compute_flavor': CONF.host,}
errmsg = "Failed removing orphaned amphora entries of LBs"
try:
self.amp_repo.delete(session, **filters)
except sqlalchemy.exc.InvalidRequestError:
except sqlalchemy.exc.NoResultFound:
pass
except sqlalchemy.exc.InvalidRequestError as e:
LOG.info(f"{errmsg}: Invalid request: {e}")

0 comments on commit d0b6523

Please sign in to comment.