Descriptiondatabase/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 of 4 now that
it's not that important to retry so many times from the free connection
list.
Patch Set 1 #Patch Set 2 : diff -r 53ebc70d4e9f843cb718f173e3225e9a0fc121e2 https://code.google.com/p/go #Patch Set 3 : diff -r 53ebc70d4e9f843cb718f173e3225e9a0fc121e2 https://code.google.com/p/go #
|