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: v15.1.0~662^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b45c08b9977acbf8703259e78702b36ffba65162;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 --- diff --git a/src/pybind/mgr/volumes/fs/volume.py b/src/pybind/mgr/volumes/fs/volume.py index 3800615aab35..0d5db8436325 100644 --- a/src/pybind/mgr/volumes/fs/volume.py +++ b/src/pybind/mgr/volumes/fs/volume.py @@ -103,10 +103,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