]> Cypherpunks repositories - gostls13.git/commit
database/sql: do not exhaust connection pool on conn request timeout
authorDaniel Theophanes <kardianos@gmail.com>
Wed, 8 Feb 2017 18:32:22 +0000 (10:32 -0800)
committerRuss Cox <rsc@golang.org>
Thu, 9 Feb 2017 01:12:19 +0000 (01:12 +0000)
commit4f6d4bb3f4461e7e25eff24254115b689495e834
tree64eac492bd28bfafa42ce9a307010051e69cef8a
parentc57d91e34cf9a9d6d39b75e2f401bdf6a27447aa
database/sql: do not exhaust connection pool on conn request timeout

Previously if a context was canceled while it was waiting for a
connection request, that connection request would leak.

To prevent this remove the pending connection request if the
context is canceled and ensure no connection has been sent on the channel.
This requires a change to how the connection requests are represented in the DB.

Fixes #18995

Change-Id: I9a274b48b8f4f7ca46cdee166faa38f56d030852
Reviewed-on: https://go-review.googlesource.com/36563
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/database/sql/sql.go
src/database/sql/sql_test.go