From 6cb4e14cf8915029b5d6f8667ab33fdd245047b2 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Tue, 31 Oct 2017 10:44:45 -0400 Subject: [PATCH] Use pooled http client for fetching providers While the TLS handshakes are a fairly small overhead compared to downloading the providers, clients in some situation are failing to complete the TLS handshake in a timely manner. It's unclear if this is because of heavily constrained clients are stalling while doing the major crpto operations, or the edge servers are throttling repeated requests from the same IPs. This should allow reusing the open TLS connection to the release edge servers during init. --- plugin/discovery/get.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/discovery/get.go b/plugin/discovery/get.go index 152aec047..ca61b088c 100644 --- a/plugin/discovery/get.go +++ b/plugin/discovery/get.go @@ -33,7 +33,7 @@ const protocolVersionHeader = "x-terraform-protocol-version" var releaseHost = "https://releases.hashicorp.com" -var httpClient = cleanhttp.DefaultClient() +var httpClient = cleanhttp.DefaultPooledClient() // An Installer maintains a local cache of plugins by downloading plugins // from an online repository.