]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/rbd_support: attempt to unregister watcher on mgr exit
authorMykola Golub <mgolub@suse.com>
Wed, 11 Mar 2020 15:03:12 +0000 (15:03 +0000)
committerJason Dillaman <dillaman@redhat.com>
Wed, 10 Feb 2021 18:37:15 +0000 (13:37 -0500)
Signed-off-by: Mykola Golub <mgolub@suse.com>
(cherry picked from commit 0bcaa261510f5bf2c69f2fe411ea3e2efe37ba60)

src/pybind/mgr/mgr_module.py
src/pybind/mgr/rbd_support/mirror_snapshot_schedule.py

index 6f3e799187724b3dd81c362baf80359bfa02e5f3..937cf5c30f876c129a400198f928cf0bcbfbf220 100644 (file)
@@ -609,8 +609,12 @@ class MgrStandbyModule(ceph_module.BaseMgrStandbyModule, MgrModuleLoggingMixin):
         self._logger = self.getLogger()
 
     def __del__(self):
+        self._cleanup()
         self._unconfigure_logging()
 
+    def _cleanup(self):
+        pass
+
     @classmethod
     def _register_options(cls, module_name):
         cls.MODULE_OPTIONS.append(
index fc7a7d986b21a9ddf9218902f0fa8354b90f5174..e9cde79b6e205b489b18a4af7ae23ecc9f7c8799 100644 (file)
@@ -162,6 +162,9 @@ class MirrorSnapshotScheduleHandler:
         self.thread = Thread(target=self.run)
         self.thread.start()
 
+    def _cleanup(self):
+        self.watchers.unregister_all()
+
     def run(self):
         try:
             self.log.info("MirrorSnapshotScheduleHandler: starting")