From: Patrick Donnelly Date: Tue, 3 Dec 2019 22:32:24 +0000 (-0800) Subject: pybind/mgr/volumes: print errors in cleanup timer X-Git-Tag: v14.2.8~53^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e48394d9cddb96bed5a0f2a8fd5b92633778e8aa;p=ceph.git pybind/mgr/volumes: print errors in cleanup timer The squelched error prevented us from knowing connection cleanup doesn't work on py3. Signed-off-by: Patrick Donnelly (cherry picked from commit b45c08b9977acbf8703259e78702b36ffba65162) --- diff --git a/src/pybind/mgr/volumes/fs/volume.py b/src/pybind/mgr/volumes/fs/volume.py index 6c5e6399da1..f034616c4f6 100644 --- a/src/pybind/mgr/volumes/fs/volume.py +++ b/src/pybind/mgr/volumes/fs/volume.py @@ -95,10 +95,14 @@ class ConnectionPool(object): recurring timer variant of Timer """ def run(self): - while not self.finished.is_set(): - self.finished.wait(self.interval) - self.function(*self.args, **self.kwargs) - self.finished.set() + try: + while not self.finished.is_set(): + self.finished.wait(self.interval) + self.function(*self.args, **self.kwargs) + self.finished.set() + except Exception as e: + log.error("ConnectionPool.RTimer: %s", e) + raise # TODO: make this configurable TIMER_TASK_RUN_INTERVAL = 30.0 # seconds