aboutsummaryrefslogtreecommitdiff
path: root/src/database/sql/fakedb_test.go
diff options
context:
space:
mode:
authorSteven Hartland <steven.hartland@multiplay.co.uk>2020-06-09 08:58:08 +0100
committerIan Lance Taylor <iant@golang.org>2021-11-03 19:32:33 +0000
commit74f99d0933d5c201fc17d90ab612cd1a9c7d425f (patch)
treed7efa1d13bc730c263ab003a902f0eee57debae1 /src/database/sql/fakedb_test.go
parentcfd016df1fba2a2a104f4cca705aa4357777986b (diff)
downloadgo-74f99d0933d5c201fc17d90ab612cd1a9c7d425f.tar.xz
database/sql: Fix idle connection reuse
Fix idle connection reuse so that ConnMaxIdleTime clears down excessive idle connections. This now ensures that db.freeConn is ordered by returnedAt and that connections that have been idle for the shortest period are reused first. In addition connectionCleanerRunLocked updates the next check deadline based on idle and maximum life time information so that we avoid waiting up to double MaxIdleTime to close connections. Corrected the calling timer of connectionCleaner. Fixes #39471 Change-Id: I6d26b3542179ef35aa13e5265a89bc0f08ba7fa1 Reviewed-on: https://go-review.googlesource.com/c/go/+/237337 Reviewed-by: Tamás Gulácsi <tgulacsi78@gmail.com> Reviewed-by: Daniel Theophanes <kardianos@gmail.com> Trust: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/database/sql/fakedb_test.go')
0 files changed, 0 insertions, 0 deletions