]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/cephadm: speedup _refresh_hosts_and_daemons by 10x
authorSebastian Wagner <sebastian.wagner@suse.com>
Fri, 19 Jun 2020 15:27:58 +0000 (17:27 +0200)
committerSebastian Wagner <sebastian.wagner@suse.com>
Fri, 19 Jun 2020 15:27:58 +0000 (17:27 +0200)
by calling 10 hosts in parallel.

Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
src/pybind/mgr/cephadm/module.py

index 8bdfe2bdbbcc28399c30d25d59e8031239b65379..6e87f4c6f5d645934c0d0d0a757f244651e0e82a 100644 (file)
@@ -1118,7 +1118,9 @@ you may want to run:
     def _refresh_hosts_and_daemons(self):
         bad_hosts = []
         failures = []
-        for host in self.cache.get_hosts():
+
+        @forall_hosts
+        def refresh(host):
             if self.cache.host_needs_check(host):
                 r = self._check_host(host)
                 if r is not None:
@@ -1139,7 +1141,8 @@ you may want to run:
                 r = self._refresh_host_osdspec_previews(host)
                 if r:
                     failures.append(r)
-
+                    
+        refresh(self.cache.get_hosts())
 
         health_changed = False
         if 'CEPHADM_HOST_CHECK_FAILED' in self.health_checks: