diff options
author | Guillaume Abrioux <gabrioux@ibm.com> | 2023-12-19 10:23:42 +0100 |
---|---|---|
committer | Guillaume Abrioux <gabrioux@ibm.com> | 2024-01-25 16:07:21 +0100 |
commit | da347d235d3fc5d6ecc98ea7ffd93f4c3c966d43 (patch) | |
tree | 5365f804e64c171bab929ad0f274df6f4c799620 /src | |
parent | node-proxy: explicitly set NodeProxy's attributes (diff) | |
download | ceph-da347d235d3fc5d6ecc98ea7ffd93f4c3c966d43.tar.xz ceph-da347d235d3fc5d6ecc98ea7ffd93f4c3c966d43.zip |
node-proxy: enhance debug log messages for locking operations
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/cephadm/cephadmlib/node_proxy/baseredfishsystem.py | 14 | ||||
-rw-r--r-- | src/cephadm/cephadmlib/node_proxy/reporter.py | 6 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/cephadm/cephadmlib/node_proxy/baseredfishsystem.py b/src/cephadm/cephadmlib/node_proxy/baseredfishsystem.py index 6102c1a8044..45c80e0209d 100644 --- a/src/cephadm/cephadmlib/node_proxy/baseredfishsystem.py +++ b/src/cephadm/cephadmlib/node_proxy/baseredfishsystem.py @@ -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: diff --git a/src/cephadm/cephadmlib/node_proxy/reporter.py b/src/cephadm/cephadmlib/node_proxy/reporter.py index 765374483b1..fb92a452346 100644 --- a/src/cephadm/cephadmlib/node_proxy/reporter.py +++ b/src/cephadm/cephadmlib/node_proxy/reporter.py @@ -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) |