Skip to content

Commit

Permalink
Fix potential deadlock in hedging request (#7962)
Browse files Browse the repository at this point in the history
Signed-off-by: kade.lee <[email protected]>
  • Loading branch information
SungJin1212 authored Dec 5, 2024
1 parent 7037331 commit d0d93db
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 d0d93db

Please sign in to comment.