From a3c42b138065c0e8cbb3cf49631b70803526efaa Mon Sep 17 00:00:00 2001 From: Alex Leong Date: Fri, 8 May 2020 12:59:43 -0700 Subject: [PATCH] remove admin server timeouts (#4350) The Linkerd control plane components' admin servers have an idle connection timeout of 10 seconds. This means that they will close connections which have been idle for 10 seconds. These components are also configured with a 10 second period for liveness checks. This introduces a race condition where connections will be idle for approximately 10 seconds between liveness checks and can idle out, potentially causing the next liveness check to fail. We remove the idle timeout so that the connection stays alive. --- pkg/admin/admin.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/pkg/admin/admin.go b/pkg/admin/admin.go index 0bd9d7660..1790b2330 100644 --- a/pkg/admin/admin.go +++ b/pkg/admin/admin.go @@ -5,7 +5,6 @@ import ( "net/http" "net/http/pprof" "strings" - "time" "github.com/prometheus/client_golang/prometheus/promhttp" log "github.com/sirupsen/logrus" @@ -23,14 +22,7 @@ func StartServer(addr string) { promHandler: promhttp.Handler(), } - s := &http.Server{ - Addr: addr, - Handler: h, - ReadTimeout: 10 * time.Second, - WriteTimeout: 10 * time.Second, - } - - log.Fatal(s.ListenAndServe()) + log.Fatal(http.ListenAndServe(addr, h)) } func (h *handler) ServeHTTP(w http.ResponseWriter, req *http.Request) {