]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
node-proxy: fix a thread/locking issue
authorGuillaume Abrioux <gabrioux@ibm.com>
Fri, 12 Jan 2024 09:11:21 +0000 (09:11 +0000)
committerGuillaume Abrioux <gabrioux@ibm.com>
Thu, 25 Jan 2024 16:12:04 +0000 (16:12 +0000)
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 <gabrioux@ibm.com>
(cherry picked from commit 06a4a637b5988a1b6d7bae5d74ae140ff9ba83b6)

src/ceph-node-proxy/ceph_node_proxy/baseredfishsystem.py

index 98f117196158ed2234b417dba7a669f962db5ab9..74d9219d1ce54521ffc5f90bfb7e16ee252c0e74 100644 (file)
@@ -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: