]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
misc: Close connections on reboot
authorSam Lang <sam.lang@inktank.com>
Tue, 5 Feb 2013 22:20:52 +0000 (16:20 -0600)
committerSam Lang <sam.lang@inktank.com>
Tue, 5 Feb 2013 22:20:52 +0000 (16:20 -0600)
When nodes are rebooted, the connections remain open
even after calling reconnect and setting up new ssh
sessions to the rebooted nodes.  This causes ECONNRESET
errors to show up in the teuthology output.

Close the existing connections before trying to reconnect.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
teuthology/misc.py

index b979b90ee3f2b0a34fe6a9b0a3900671b5286b5a..bb95550f8c48d21a97c825ea86d8a1b690d91532 100644 (file)
@@ -515,6 +515,10 @@ def reconnect(ctx, timeout):
     """
     log.info('Re-opening connections...')
     starttime = time.time()
+
+    for r in ctx.cluster.remotes.iterkeys():
+        r.ssh.close()
+
     need_reconnect = ctx.cluster.remotes.keys()
     while need_reconnect:
         for remote in need_reconnect: