Skip to content

Commit

Permalink
Fix potential deadlock in hedging request (thanos-io#7962)
Browse files Browse the repository at this point in the history
Signed-off-by: kade.lee <[email protected]>
  • Loading branch information
SungJin1212 authored and saswatamcode committed Dec 11, 2024
1 parent e0812e2 commit 8f5d3fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/exthttp/hedging.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 8f5d3fb

Please sign in to comment.