summaryrefslogtreecommitdiff
path: root/server/profiler.py
diff options
context:
space:
mode:
authormbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4>2009-07-28 23:28:37 +0000
committermbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4>2009-07-28 23:28:37 +0000
commit71a9dfc19054bf120722960d70178d9fb7170056 (patch)
treea9561cfdc6c7708d7173eeb0124270ae1f5f79f4 /server/profiler.py
parent876e1d632755520c2cd68cab2d3ad90fa863ce4e (diff)
Fix the server profiler calculation that determines what hosts already
have profiler clients. First of all, fixes a bug where we grab a set of hosts when we should be grabbing hostnames. But it also includes an enhancement where it checks if the client directory on the remote machine still exists, and if it doesn't it drops that host from the set of ones where we already have a client, so that it can be reinstalled. This should handle cases where the profiler is on a disk that was somehow erased. Risk: Low Visibility: Make the server profiler installs more resilient to profilers being removed in between tests. Signed-off-by: John Admanski <jadmanski@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@3473 592f7852-d20e-0410-864c-8624ca9c26a4
Diffstat (limited to 'server/profiler.py')
-rw-r--r--server/profiler.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/server/profiler.py b/server/profiler.py
index 997df1ac..0e278feb 100644
--- a/server/profiler.py
+++ b/server/profiler.py
@@ -92,7 +92,21 @@ class profiler_proxy(object):
if not
(host.get_autodir() and
host.get_autodir().startswith(PROFILER_TMPDIR)))
- profiler_hosts = set(self.installed_hosts.keys())
+ logging.debug('Hosts currently in use: %s', in_use_hosts)
+
+ # determine what valid host objects we already have installed
+ profiler_hosts = set()
+ for host, (at, profiler_dir) in self.installed_hosts.items():
+ if host.path_exists(profiler_dir):
+ profiler_hosts.add(host.hostname)
+ else:
+ # the profiler was wiped out somehow, drop this install
+ logging.warning('The profiler client on %s at %s was deleted',
+ host.hostname, profiler_dir)
+ host.close()
+ del self.installed_hosts[host]
+ logging.debug('Hosts with profiler clients already installed: %s',
+ profiler_hosts)
# install autotest on any new hosts in use
for hostname in in_use_hosts - profiler_hosts: