Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mhamza/no truncated logs #136

Closed
wants to merge 18 commits into from
Prev Previous commit
Reduce sleep duration in tryReturnConn function
mhamza15 authored Jan 29, 2025
commit 4a23ab280790e13d10c1fe92551d033623b20444
2 changes: 1 addition & 1 deletion go/pools/smartconnpool/waitlist.go
Original file line number Diff line number Diff line change
@@ -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