From eae72af6b36130dc016b5e22a8c787ef00884698 Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Wed, 16 Nov 2022 14:31:17 +0800 Subject: [PATCH] Wait for the response of pipelineWork in background and return it to pool --- client.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client.go b/client.go index e4450919fe..4fad6edcab 100644 --- a/client.go +++ b/client.go @@ -2411,6 +2411,11 @@ func (c *pipelineConnClient) DoDeadline(req *Request, resp *Response, deadline t releasePipelineWork(&c.workPool, w) case <-w.t.C: err = ErrTimeout + go func() { + // Wait for the response in background. + <-w.done + releasePipelineWork(&c.workPool, w) + }() } return err