Merge pull request #12527 from AlanCoding/offline_db

Further resiliency changes, specifically focused on case of database going offline
This commit is contained in:
Alan Rominger
2022-08-17 10:10:50 -04:00
committed by GitHub
6 changed files with 86 additions and 13 deletions

View File

@@ -313,7 +313,12 @@ class Metrics:
self.previous_send_metrics.set(current_time)
self.previous_send_metrics.store_value(self.conn)
finally:
lock.release()
try:
lock.release()
except Exception as exc:
# After system failures, we might throw redis.exceptions.LockNotOwnedError
# this is to avoid print a Traceback, and importantly, avoid raising an exception into parent context
logger.warning(f'Error releasing subsystem metrics redis lock, error: {str(exc)}')
def load_other_metrics(self, request):
# data received from other nodes are stored in their own keys