From 0b451f94755af82f5c00c15fb9ea4e0034919689 Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Thu, 3 Nov 2011 13:08:39 -0700 Subject: [PATCH] Keep each ssh connection alive. With long-running jobs like thrashing, ssh connections were timing out. --- teuthology/misc.py | 1 + teuthology/task/internal.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/teuthology/misc.py b/teuthology/misc.py index cf090f529a728..7ff1b9865507b 100644 --- a/teuthology/misc.py +++ b/teuthology/misc.py @@ -331,6 +331,7 @@ def reconnect(ctx, timeout): remote.ssh = connection.connect( user_at_host=remote.name, host_key=ctx.config['targets'][remote.name], + keep_alive=True, ) except socket.timeout: pass diff --git a/teuthology/task/internal.py b/teuthology/task/internal.py index 0f2855c430252..a7df647503cab 100644 --- a/teuthology/task/internal.py +++ b/teuthology/task/internal.py @@ -120,7 +120,9 @@ def connect(ctx, config): log.debug('connecting to %s', t) remotes.append( remote.Remote(name=t, - ssh=connection.connect(user_at_host=t, host_key=key))) + ssh=connection.connect(user_at_host=t, + host_key=key, + keep_alive=True))) ctx.cluster = orchestra.cluster.Cluster() if 'roles' in ctx.config: for rem, roles in zip(remotes, ctx.config['roles']): -- 2.39.5