Skip to content

Commit cb19b3c

Browse files
committed
transport: pool, stop shard refill faster when context is done
Fixes #291
1 parent 8c54361 commit cb19b3c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

transport/pool.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,9 @@ func (r *PoolRefiller) fill(ctx context.Context) {
233233
if r.pool.loadConn(i) != nil {
234234
continue
235235
}
236-
236+
if ctx.Err() != nil {
237+
return
238+
}
237239
si.Shard = uint16(i)
238240
span := startSpan()
239241
conn, err := OpenShardConn(ctx, r.addr, si, r.cfg)

0 commit comments

Comments
 (0)