From fb7853ca63a655a04ab374156adff7d42ce2abbf Mon Sep 17 00:00:00 2001 From: Alanmas Date: Tue, 13 Apr 2021 19:12:37 -0500 Subject: [PATCH] roachprod: shorten the connection timeout for ssh Based on #47567 we need to ensure that roachprod has timout for ssh connection after 5 seconds. We are adding a timeout inside newRemoteSession function so the roachtest context cancellation does hide failure information by kill hanging processes before they fail. Release note: None --- pkg/cmd/roachprod/install/session.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/cmd/roachprod/install/session.go b/pkg/cmd/roachprod/install/session.go index 1a667558285c..1840aa2bbd47 100644 --- a/pkg/cmd/roachprod/install/session.go +++ b/pkg/cmd/roachprod/install/session.go @@ -70,6 +70,9 @@ func newRemoteSession(user, host string, logdir string) (*remoteSession, error) // // https://github.com/cockroachdb/cockroach/issues/35337 "-o", "ServerAliveInterval=60", + // Timeout long connections so failure information is not lost by the roachtest + // context cancellation killing hanging roachprod processes. + "-o", "ConnectTimeout=5", } args = append(args, sshAuthArgs()...) ctx, cancel := context.WithCancel(context.Background())