From f0f86500c7e2e5dac7288ff2a409fc16fe0646f4 Mon Sep 17 00:00:00 2001 From: Matt Jaffee Date: Sat, 29 Feb 2020 13:41:49 -0600 Subject: [PATCH] add minimal fix for connection reuse issue - @tgruben has a more complete fix --- http/client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/http/client.go b/http/client.go index 769d18d46..507d1d632 100644 --- a/http/client.go +++ b/http/client.go @@ -1121,7 +1121,9 @@ func (c *InternalClient) SendMessage(ctx context.Context, uri *pilosa.URI, msg [ if err != nil { return errors.Wrap(err, "executing request") } - return errors.Wrap(resp.Body.Close(), "closing response body") + defer resp.Body.Close() + _, err = io.Copy(ioutil.Discard, resp.Body) + return errors.Wrap(err, "draining SendMessage response body") } // TranslateKeysNode sends a key translation request to a specific node.