]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
pybind/mgr/pg_autoscaler: implement shutdown method
authorPatrick Donnelly <pdonnell@redhat.com>
Tue, 5 Nov 2019 06:12:48 +0000 (22:12 -0800)
committerPatrick Donnelly <pdonnell@redhat.com>
Tue, 5 Nov 2019 06:14:42 +0000 (22:14 -0800)
Otherwise the mgr cannot shutdown because it waits for the pg_autoscaler
thread forever.

Fixes: https://tracker.ceph.com/issues/42640
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/pybind/mgr/pg_autoscaler/module.py

index 0f8dd1bde875632c5be0456313321da9b25df26d..345fc7e18606634e31e3f40033056cc30ea7b83d 100644 (file)
@@ -175,6 +175,10 @@ class PgAutoscaler(MgrModule):
             self._update_progress_events()
             self._shutdown.wait(timeout=int(self.sleep_interval))
 
+    def shutdown(self):
+        self.log.info('Stopping pg_autoscaler')
+        self._shutdown.set()
+
     def get_subtree_resource_status(self, osdmap, crush):
         """
         For each CRUSH subtree of interest (i.e. the roots under which