From 4a23ab280790e13d10c1fe92551d033623b20444 Mon Sep 17 00:00:00 2001 From: Mohamed Hamza Date: Wed, 29 Jan 2025 17:27:27 -0500 Subject: [PATCH] Reduce sleep duration in tryReturnConn function --- go/pools/smartconnpool/waitlist.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/pools/smartconnpool/waitlist.go b/go/pools/smartconnpool/waitlist.go index 42e49a78e8d..06a08eb4b10 100644 --- a/go/pools/smartconnpool/waitlist.go +++ b/go/pools/smartconnpool/waitlist.go @@ -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