diff --git a/pkg/exthttp/hedging.go b/pkg/exthttp/hedging.go index 09a1b3e8a2..af200bd92e 100644 --- a/pkg/exthttp/hedging.go +++ b/pkg/exthttp/hedging.go @@ -48,11 +48,11 @@ func (hrt *hedgingRoundTripper) RoundTrip(req *http.Request) (*http.Response, er } duration := float64(time.Since(start).Milliseconds()) hrt.mu.Lock() + defer hrt.mu.Unlock() err = hrt.TDigest.Add(duration) if err != nil { return nil, err } - hrt.mu.Unlock() return resp, err }