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.
This commit is contained in:
Alex Leong 2020-05-08 12:59:43 -07:00 committed by GitHub
parent f62a2e6ee4
commit a3c42b1380
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 9 deletions

View File

@ -5,7 +5,6 @@ import (
"net/http" "net/http"
"net/http/pprof" "net/http/pprof"
"strings" "strings"
"time"
"github.com/prometheus/client_golang/prometheus/promhttp" "github.com/prometheus/client_golang/prometheus/promhttp"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
@ -23,14 +22,7 @@ func StartServer(addr string) {
promHandler: promhttp.Handler(), promHandler: promhttp.Handler(),
} }
s := &http.Server{ log.Fatal(http.ListenAndServe(addr, h))
Addr: addr,
Handler: h,
ReadTimeout: 10 * time.Second,
WriteTimeout: 10 * time.Second,
}
log.Fatal(s.ListenAndServe())
} }
func (h *handler) ServeHTTP(w http.ResponseWriter, req *http.Request) { func (h *handler) ServeHTTP(w http.ResponseWriter, req *http.Request) {