Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(86)

Issue 168060044: database/sql: Retry with a fresh connection after maxBa...

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 5 months ago by johto
Modified:
9 years, 5 months ago
Reviewers:
Visibility:
Public.

Description

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 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+122 lines, -27 lines) Patch
M src/database/sql/fakedb_test.go View 1 5 chunks +7 lines, -5 lines 0 comments Download
M src/database/sql/sql.go View 1 2 9 chunks +42 lines, -22 lines 0 comments Download
M src/database/sql/sql_test.go View 1 2 1 chunk +73 lines, -0 lines 0 comments Download

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b