From 0d35473d415c5505520d9560b87457893575ac0b Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 4 Sep 2014 11:24:01 -0700 Subject: [PATCH] communicator/ssh: make TCP keep-alive period shorter [GH-1232] --- CHANGELOG.md | 1 + communicator/ssh/connect.go | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad4417fd8..0822340f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ BUG FIXES: SSH. [GH-1445] * core: Fix crash that could happen with a well timed double Ctrl-C. [GH-1328] [GH-1314] + * core: SSH TCP keepalive period is now 5 seconds (shorter). [GH-1232] * builder/amazon-chroot: Can properly build HVM images now. [GH-1360] * builder/amazon-chroot: Fix crash in root device check. [GH-1360] * builder/amazon-instance: Fix deprecation warning for `ec2-bundle-vol` diff --git a/communicator/ssh/connect.go b/communicator/ssh/connect.go index 1a01e024c..b280f3ead 100644 --- a/communicator/ssh/connect.go +++ b/communicator/ssh/connect.go @@ -17,6 +17,7 @@ func ConnectFunc(network, addr string) func() (net.Conn, error) { if tcpConn, ok := c.(*net.TCPConn); ok { tcpConn.SetKeepAlive(true) + tcpConn.SetKeepAlivePeriod(5 * time.Second) } return c, nil