Skip to content

Commit 52d1f17

Browse files
committed
avoid excessive spinning when context canceled & waiting on contexts channel to close
1 parent f830d50 commit 52d1f17

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

driver/driver.go

+1
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ func (ci connInfo) Connect(ctx context.Context) (sqldriver.Conn, error) {
198198
var ok bool
199199
select {
200200
case <-ctx.Done():
201+
ctx = context.Background()
201202
_ = c.Conn.Close()
202203
case ctx, ok = <-contexts:
203204
if !ok {

0 commit comments

Comments
 (0)