Skip to content

Commit

Permalink
add old pool log
Browse files Browse the repository at this point in the history
  • Loading branch information
mhamza15 committed Jan 29, 2025
1 parent 9accc96 commit 7d10c28
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion go/pools/smartconnpool/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package smartconnpool

import (
"context"
"fmt"
"slices"
"sync"
"sync/atomic"
Expand Down Expand Up @@ -510,10 +511,12 @@ func (pool *ConnPool[C]) get(ctx context.Context) (*Pooled[C], error) {
// to other clients, wait until one of the connections is returned
if conn == nil {
start := time.Now()

oldPool := fmt.Sprintf("%+v", pool)
conn, err = pool.wait.waitForConn(ctx, nil)
if err != nil {
log.Errorf("===================== ERROR: waitForConn err: %s", err.Error())
log.Errorf("%+v", pool)
log.Errorf("Old pool: \n%s\n=================\nNew pool: \n%+v", oldPool, pool)
return nil, ErrTimeout
}
pool.recordWait(start)
Expand Down

0 comments on commit 7d10c28

Please sign in to comment.