]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.8] database/sql: do not exhaust connection pool on conn request...
authorDaniel Theophanes <kardianos@gmail.com>
Wed, 8 Feb 2017 18:32:22 +0000 (10:32 -0800)
committerRuss Cox <rsc@golang.org>
Fri, 10 Feb 2017 17:53:29 +0000 (17:53 +0000)
commitf1e44a4b7426e03bff7ed4f75a91e57c498d3463
tree341c2f1814ca729a91df51e33ad9b1deadd4ff55
parent3ade54063e9a219e50e53a6a042013e2cafc1251
[release-branch.go1.8] 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>
Reviewed-on: https://go-review.googlesource.com/36613
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/database/sql/sql.go
src/database/sql/sql_test.go