diff --git a/go/vt/vttablet/tabletserver/query_executor.go b/go/vt/vttablet/tabletserver/query_executor.go index 820df00e26c..c6a52ba300b 100644 --- a/go/vt/vttablet/tabletserver/query_executor.go +++ b/go/vt/vttablet/tabletserver/query_executor.go @@ -795,9 +795,11 @@ func (qre *QueryExecutor) getStreamConn() (*connpool.PooledConn, error) { start := time.Now() conn, err := qre.tsv.qe.streamConns.Get(ctx, qre.setting) + + qre.logStats.WaitingForConnection += time.Since(start) + switch err { case nil: - qre.logStats.WaitingForConnection += time.Since(start) return conn, nil case connpool.ErrConnPoolClosed: return nil, err