From: Guillaume Abrioux Date: Fri, 12 Jan 2024 09:11:21 +0000 (+0000) Subject: node-proxy: fix a thread/locking issue X-Git-Tag: v18.2.4~314^2~9 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=aff9d6f9ea73f3a603c066ec56c00630cbf99790;p=ceph.git node-proxy: fix a thread/locking issue This `sleep(5)` should be initiated *after* the lock is released. Otherwise, it can cause troubles with the reporter loop which can never acquire the lock. Signed-off-by: Guillaume Abrioux (cherry picked from commit 06a4a637b5988a1b6d7bae5d74ae140ff9ba83b6) --- diff --git a/src/ceph-node-proxy/ceph_node_proxy/baseredfishsystem.py b/src/ceph-node-proxy/ceph_node_proxy/baseredfishsystem.py index 98f117196158e..74d9219d1ce54 100644 --- a/src/ceph-node-proxy/ceph_node_proxy/baseredfishsystem.py +++ b/src/ceph-node-proxy/ceph_node_proxy/baseredfishsystem.py @@ -73,13 +73,13 @@ class BaseRedfishSystem(BaseSystem): executor.map(lambda f: f(), update_funcs) self.data_ready = True - sleep(5) except RuntimeError as e: self.run = False self.log.logger.error(f'Error detected, trying to gracefully log out from redfish api.\n{e}') self.client.logout() finally: self.lock.release() + sleep(5) self.log.logger.debug('lock released in the update loop.') def flush(self) -> None: