From b15ced1f8b27337224dd9970702b1d4f4a965f16 Mon Sep 17 00:00:00 2001 From: suitableZebraCaller <15273771+suitableZebraCaller@users.noreply.github.com> Date: Tue, 20 Dec 2022 15:43:32 +1100 Subject: [PATCH] fix: Replications Close Idle TCP Connections --- replications/remotewrite/writer.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/replications/remotewrite/writer.go b/replications/remotewrite/writer.go index 854d870b7ad..b05f6812279 100644 --- a/replications/remotewrite/writer.go +++ b/replications/remotewrite/writer.go @@ -243,6 +243,9 @@ func PostWrite(ctx context.Context, config *influxdb.ReplicationHTTPConfig, data err = invalidResponseCode(res.StatusCode) } + // Close Idle connections and prevent reaching file descriptor limit + conf.HTTPClient.CloseIdleConnections() + // Must return the response so that the status code and headers can be inspected by the caller, even if the response // was not 204. return res, err