Skip to content

Commit 7d10c28

Browse files
committed
add old pool log
1 parent 9accc96 commit 7d10c28

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

go/pools/smartconnpool/pool.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package smartconnpool
1818

1919
import (
2020
"context"
21+
"fmt"
2122
"slices"
2223
"sync"
2324
"sync/atomic"
@@ -510,10 +511,12 @@ func (pool *ConnPool[C]) get(ctx context.Context) (*Pooled[C], error) {
510511
// to other clients, wait until one of the connections is returned
511512
if conn == nil {
512513
start := time.Now()
514+
515+
oldPool := fmt.Sprintf("%+v", pool)
513516
conn, err = pool.wait.waitForConn(ctx, nil)
514517
if err != nil {
515518
log.Errorf("===================== ERROR: waitForConn err: %s", err.Error())
516-
log.Errorf("%+v", pool)
519+
log.Errorf("Old pool: \n%s\n=================\nNew pool: \n%+v", oldPool, pool)
517520
return nil, ErrTimeout
518521
}
519522
pool.recordWait(start)

0 commit comments

Comments
 (0)