]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/rbd_support: bail from refresh_pools() when there is no schedule
authorIlya Dryomov <idryomov@gmail.com>
Thu, 16 Jun 2022 17:23:58 +0000 (19:23 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 21 Jun 2022 16:54:50 +0000 (18:54 +0200)
Make refresh_pools() behave the same as refresh_images().

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 7d1e644b62909fb3844c0559f5ea94419eae6864)

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

index 97f4bf23609434da645267419600537955834830..013b210266bd9ff172a5614dc2dc14e571157eb6 100644 (file)
@@ -512,6 +512,7 @@ class MirrorSnapshotScheduleHandler:
 
         with self.lock:
             if not self.schedules:
+                self.log.debug("MirrorSnapshotScheduleHandler: no schedules")
                 self.watchers.unregister_all()
                 self.images = {}
                 self.queue = {}
index 67b637b1c93d20fc6ea348de47260faa5786854e..cae03e3eb35f1b64b19d791e63744dabebefb2cf 100644 (file)
@@ -82,6 +82,14 @@ class TrashPurgeScheduleHandler:
 
         self.load_schedules()
 
+        with self.lock:
+            if not self.schedules:
+                self.log.debug("TrashPurgeScheduleHandler: no schedules")
+                self.pools = {}
+                self.queue = {}
+                self.last_refresh_pools = datetime.now()
+                return
+
         pools: Dict[str, Dict[str, str]] = {}
 
         for pool_id, pool_name in get_rbd_pools(self.module).items():