From 73dbd27ace84d8d6da8f17ef53c1761e924ed0d4 Mon Sep 17 00:00:00 2001 From: "Luis Gustavo S. Barreto" Date: Fri, 4 Nov 2022 13:45:08 -0300 Subject: [PATCH] pkg: disable reuse of tcp connection with same host --- pkg/api/client/client.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/api/client/client.go b/pkg/api/client/client.go index de943318b78..a690ca6ff88 100644 --- a/pkg/api/client/client.go +++ b/pkg/api/client/client.go @@ -34,6 +34,11 @@ func NewClient(opts ...Opt) Client { return r.StatusCode() >= http.StatusInternalServerError && r.StatusCode() != http.StatusNotImplemented }) + // disable reuse of TCP connection with same host + if transport, ok := httpClient.GetClient().Transport.(*http.Transport); ok { + transport.MaxIdleConnsPerHost = -1 + } + c := &client{ host: apiHost, port: apiPort,