From: Manuel Lausch Date: Wed, 8 Jul 2020 09:42:37 +0000 (+0200) Subject: mgr/progress: Skip pg_summary update if _events dict is empty. X-Git-Tag: v15.2.5~114^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fe0dbf4124af87b185025cb513f374b895aa9d30;p=ceph.git mgr/progress: Skip pg_summary update if _events dict is empty. The get call of pg_stats and pg_ready are expensive and are not necessary in this case. This avoids blocking other modules like the prometheus module Fixes: https://tracker.ceph.com/issues/46416 Signed-off-by: Manuel Lausch (cherry picked from commit 1031edd89d09d18812a3f11b7cbb2ce6759bad13) --- diff --git a/src/pybind/mgr/progress/module.py b/src/pybind/mgr/progress/module.py index ccc73bf2611..470e4b0a611 100644 --- a/src/pybind/mgr/progress/module.py +++ b/src/pybind/mgr/progress/module.py @@ -533,6 +533,10 @@ class Module(MgrModule): )) self._osdmap_changed(old_osdmap, self._latest_osdmap) elif notify_type == "pg_summary": + # if there are no events we will skip this here to avoid + # expensive get calls + if len(self._events) == 0: + return data = self.get("pg_stats") ready = self.get("pg_ready") for ev_id in list(self._events):