From: Patrick Donnelly Date: Wed, 5 Aug 2020 22:54:33 +0000 (-0700) Subject: pybind/mgr/volumes: add global lock debug X-Git-Tag: v14.2.12~82^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9013b1f64c81bc6e90876057e5a167b2e0b79ef4;p=ceph.git pybind/mgr/volumes: add global lock debug Fixes: https://tracker.ceph.com/issues/47149 Signed-off-by: Patrick Donnelly (cherry picked from commit d399d4c05bfa432221daf4f7b3635aef1bf35dff) --- diff --git a/src/pybind/mgr/volumes/fs/operations/lock.py b/src/pybind/mgr/volumes/fs/operations/lock.py index f9c44dc4f6798..ab5f1d0461938 100644 --- a/src/pybind/mgr/volumes/fs/operations/lock.py +++ b/src/pybind/mgr/volumes/fs/operations/lock.py @@ -1,6 +1,9 @@ from contextlib import contextmanager +import logging from threading import Lock +log = logging.getLogger(__name__) + # singleton design pattern taken from http://www.aleax.it/5ep.html class GlobalLock(object): @@ -32,5 +35,8 @@ class GlobalLock(object): @contextmanager def lock_op(self): + log.debug("entering global lock") with self._shared_state['lock']: + log.debug("acquired global lock") yield + log.debug("exited global lock")