Skip to content

Commit

Permalink
Reduce sleep duration in tryReturnConn function
Browse files Browse the repository at this point in the history
  • Loading branch information
mhamza15 authored Jan 29, 2025
1 parent a4b4039 commit 4a23ab2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion go/pools/smartconnpool/waitlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (wl *waitlist[D]) tryReturnConn(conn *Pooled[D]) bool {
// fast path: if there's nobody waiting there's nothing to do
if wl.list.Len() == 0 {
// HACK: we're gonna sleep for a bit and try again, to see if there are still no waiters
time.Sleep(250 * time.Millisecond)
time.Sleep(10 * time.Millisecond)
if wl.list.Len() == 0 {
log.Error("======================= WE HIT THE FAST PATH, WE'RE RETURNING")
return false
Expand Down

0 comments on commit 4a23ab2

Please sign in to comment.