From 37ad172d0d9e2a439158c5174bcf8b690a1dc3e7 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Thu, 25 Jan 2018 17:16:28 -0500 Subject: [PATCH] extend disco timeout Extend the discovery timeout from 4 seconds to 11 seconds. This gives a little more time for a slow host to response. The duration of 11s keeps the delay reasonable, and puts it just after the default TLS handshake timeout of 10s for easier differentiation of the error cases. --- svchost/disco/disco.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/svchost/disco/disco.go b/svchost/disco/disco.go index bc2200f34..db4046371 100644 --- a/svchost/disco/disco.go +++ b/svchost/disco/disco.go @@ -25,9 +25,9 @@ import ( const ( discoPath = "/.well-known/terraform.json" - maxRedirects = 3 // arbitrary-but-small number to prevent runaway redirect loops - discoTimeout = 4 * time.Second // arbitrary-but-small time limit to prevent UI "hangs" during discovery - maxDiscoDocBytes = 1 * 1024 * 1024 // 1MB - to prevent abusive services from using loads of our memory + maxRedirects = 3 // arbitrary-but-small number to prevent runaway redirect loops + discoTimeout = 11 * time.Second // arbitrary-but-small time limit to prevent UI "hangs" during discovery + maxDiscoDocBytes = 1 * 1024 * 1024 // 1MB - to prevent abusive services from using loads of our memory ) var userAgent = fmt.Sprintf("Terraform/%s (service discovery)", version.String())