1
0
mirror of https://github.com/golang/go synced 2024-11-20 02:34:42 -07:00
go/src/database/sql
Marko Tiikkaja c468f94672 database/sql: Retry with a fresh connection after maxBadConnRetries
Previously if the connection pool was larger than maxBadConnRetries
and there were a lot of bad connections in the pool (for example if
the database server was restarted), a query might have failed with an
ErrBadConn unnecessarily.  Instead of trying to guess how many times
to retry, try maxBadConnRetries times and then force a fresh
connection to be used for the last attempt.  At the same time, lower
maxBadConnRetries to a smaller value now that it's not that important
to retry so many times from the free connection list.

Fixes #8834

Change-Id: I6542f151a766a658980fb396fa4880ecf5874e3d
Reviewed-on: https://go-review.googlesource.com/2034
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-04-08 16:18:36 +00:00
..
driver build: move package sources from src/pkg to src 2014-09-08 00:08:51 -04:00
convert_test.go build: move package sources from src/pkg to src 2014-09-08 00:08:51 -04:00
convert.go build: move package sources from src/pkg to src 2014-09-08 00:08:51 -04:00
doc.txt build: move package sources from src/pkg to src 2014-09-08 00:08:51 -04:00
example_test.go build: move package sources from src/pkg to src 2014-09-08 00:08:51 -04:00
fakedb_test.go database/sql: Retry with a fresh connection after maxBadConnRetries 2015-04-08 16:18:36 +00:00
sql_test.go database/sql: Retry with a fresh connection after maxBadConnRetries 2015-04-08 16:18:36 +00:00
sql.go database/sql: Retry with a fresh connection after maxBadConnRetries 2015-04-08 16:18:36 +00:00