]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
node-proxy: enhance debug log messages for locking operations
authorGuillaume Abrioux <gabrioux@ibm.com>
Tue, 19 Dec 2023 09:23:42 +0000 (09:23 +0000)
committerGuillaume Abrioux <gabrioux@ibm.com>
Thu, 25 Jan 2024 16:01:04 +0000 (16:01 +0000)
This commit updates the debug log messages in the BaseRedfishSystem
and Reporter classes. The adjustments made enhance the clarity and
precision of the messages by specifically identifying acquired
and released locks, detailing their context, thereby improving the
understanding of the control flow during locking operations
in these components.

Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
(cherry picked from commit e68dceb1d2d6b4e6871c77465e1e23f2e726f84c)

src/cephadm/cephadmlib/node_proxy/baseredfishsystem.py
src/cephadm/cephadmlib/node_proxy/reporter.py

index 6102c1a8044dbdbc56f9bf5d9a980170f9e91496..45c80e0209d4e6c028dec68459a25f55d5ae1c50 100644 (file)
@@ -49,9 +49,9 @@ class BaseRedfishSystem(BaseSystem):
         #  this loop can have:
         #  - caching logic
         while self.run:
-            self.log.logger.debug('waiting for a lock.')
+            self.log.logger.debug('waiting for a lock in the update loop.')
             self.lock.acquire()
-            self.log.logger.debug('lock acquired.')
+            self.log.logger.debug('lock acquired in the update loop.')
             try:
                 self._update_system()
                 self._update_sn()
@@ -74,19 +74,19 @@ class BaseRedfishSystem(BaseSystem):
                 self.client.logout()
             finally:
                 self.lock.release()
-                self.log.logger.debug('lock released.')
+                self.log.logger.debug('lock released in the update loop.')
 
     def flush(self) -> None:
-        self.log.logger.info('Acquiring lock to flush data.')
+        self.log.logger.debug('Acquiring lock to flush data.')
         self.lock.acquire()
-        self.log.logger.info('Lock acquired, flushing data.')
+        self.log.logger.debug('Lock acquired, flushing data.')
         self._system = {}
         self.previous_data = {}
         self.log.logger.info('Data flushed.')
         self.data_ready = False
-        self.log.logger.info('Data marked as not ready.')
+        self.log.logger.debug('Data marked as not ready.')
         self.lock.release()
-        self.log.logger.info('Lock released.')
+        self.log.logger.debug('Released the lock after flushing data.')
 
     @retry(retries=10, delay=2)
     def _get_path(self, path: str) -> Dict:
index 765374483b1f35f4f1a8fed2feb3dfeb42ad753f..fb92a45234673bc026c50c263c83e5691c86638f 100644 (file)
@@ -43,9 +43,9 @@ class Reporter:
             # scenario probably we should just send the sub-parts
             # that have changed to minimize the traffic in
             # dense clusters
-            self.log.logger.debug('waiting for a lock.')
+            self.log.logger.debug('waiting for a lock in reporter loop.')
             self.system.lock.acquire()
-            self.log.logger.debug('lock acquired.')
+            self.log.logger.debug('lock acquired in reporter loop.')
             if self.system.data_ready:
                 self.log.logger.info('data ready to be sent to the mgr.')
                 if not self.system.get_system() == self.system.previous_data:
@@ -70,5 +70,5 @@ class Reporter:
                 else:
                     self.log.logger.info('no diff, not sending data to the mgr.')
             self.system.lock.release()
-            self.log.logger.debug('lock released.')
+            self.log.logger.debug('lock released in reporter loop.')
             time.sleep(5)