• Marko Tiikkaja's avatar
    database/sql: Retry with a fresh connection after maxBadConnRetries · c468f946
    Marko Tiikkaja authored
    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: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    c468f946
Name
Last commit
Last update
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...