Skip to content

Commit

Permalink
Fix potential deadlock in hedging request
Browse files Browse the repository at this point in the history
Signed-off-by: kade.lee <tjdwls1201@gmail.com>
  • Loading branch information
SungJin1212 committed Dec 5, 2024
1 parent 7037331 commit bf4a7a6
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 bf4a7a6

Please sign in to comment.