From 3fc6599aa284f0a88ec38c666a2fbfa63dc0a518 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Mon, 9 Mar 2020 13:30:53 +0200 Subject: [PATCH] app/vmagent: properly apply `-remoteWrite.sendTimeout` to fasthttp.HostClient --- app/vmagent/remotewrite/client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/vmagent/remotewrite/client.go b/app/vmagent/remotewrite/client.go index cb1083dae..71f353e38 100644 --- a/app/vmagent/remotewrite/client.go +++ b/app/vmagent/remotewrite/client.go @@ -69,6 +69,7 @@ func newClient(remoteWriteURL, urlLabelValue string, fq *persistentqueue.FastQue if readTimeout <= 0 { readTimeout = time.Minute } + writeTimeout := readTimeout var u fasthttp.URI u.Update(remoteWriteURL) scheme := string(u.Scheme()) @@ -109,7 +110,7 @@ func newClient(remoteWriteURL, urlLabelValue string, fq *persistentqueue.FastQue MaxConns: maxConns, MaxIdleConnDuration: 10 * readTimeout, ReadTimeout: readTimeout, - WriteTimeout: 10 * time.Second, + WriteTimeout: writeTimeout, MaxResponseBodySize: 1024 * 1024, } c := &client{