app/vmagent: properly apply -remoteWrite.sendTimeout to fasthttp.HostClient

This commit is contained in:
Aliaksandr Valialkin 2020-03-09 13:30:53 +02:00
parent d39dd8aa69
commit 3fc6599aa2

View file

@ -69,6 +69,7 @@ func newClient(remoteWriteURL, urlLabelValue string, fq *persistentqueue.FastQue
if readTimeout <= 0 { if readTimeout <= 0 {
readTimeout = time.Minute readTimeout = time.Minute
} }
writeTimeout := readTimeout
var u fasthttp.URI var u fasthttp.URI
u.Update(remoteWriteURL) u.Update(remoteWriteURL)
scheme := string(u.Scheme()) scheme := string(u.Scheme())
@ -109,7 +110,7 @@ func newClient(remoteWriteURL, urlLabelValue string, fq *persistentqueue.FastQue
MaxConns: maxConns, MaxConns: maxConns,
MaxIdleConnDuration: 10 * readTimeout, MaxIdleConnDuration: 10 * readTimeout,
ReadTimeout: readTimeout, ReadTimeout: readTimeout,
WriteTimeout: 10 * time.Second, WriteTimeout: writeTimeout,
MaxResponseBodySize: 1024 * 1024, MaxResponseBodySize: 1024 * 1024,
} }
c := &client{ c := &client{