Skip to content

Commit

Permalink
add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
mhamza15 committed Jan 27, 2025
1 parent c84e1cf commit f2c030e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions go/pools/smartconnpool/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -511,12 +511,14 @@ func (pool *ConnPool[C]) get(ctx context.Context) (*Pooled[C], error) {
start := time.Now()
conn, err = pool.wait.waitForConn(ctx, nil)
if err != nil {
log.Errorf("===================== ERROR: waitForConn err: %s", err.Error())
return nil, ErrTimeout
}
pool.recordWait(start)
}
// no connections available and no connections to wait for (pool is closed)
if conn == nil {
log.Errorf("====================== ERROR: conn == nil err")
return nil, ErrTimeout
}

Expand Down Expand Up @@ -568,12 +570,14 @@ func (pool *ConnPool[C]) getWithSetting(ctx context.Context, setting *Setting) (
start := time.Now()
conn, err = pool.wait.waitForConn(ctx, setting)
if err != nil {
log.Errorf("===================== getWithSetting ERROR: waitForConn err: %s", err.Error())
return nil, ErrTimeout
}
pool.recordWait(start)
}
// no connections available and no connections to wait for (pool is closed)
if conn == nil {
log.Errorf("====================== getWithSetting ERROR: conn == nil err")
return nil, ErrTimeout
}

Expand Down

0 comments on commit f2c030e

Please sign in to comment.