You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of Go1.17, retry logic and various other logic rely on the exact error value driver.ErrBadConn being returned if the connection is in a bad state. Various calls, such as the IsValid method may be called if supported on a driver that will prevent bad connections from poisoning the pool. However, right now, a driver still has to make a decision to return an interesting error or to get retry logic.
No change in consensus, so accepted. 🎉
This issue now tracks the work of implementing the proposal.
— rsc for the proposal review group
rsc
changed the title
proposal: database/sql: use errors.Is when checking for driver.ErrBadConn
database/sql: use errors.Is when checking for driver.ErrBadConn
Oct 20, 2021
As of Go1.17, retry logic and various other logic rely on the exact error value
driver.ErrBadConn
being returned if the connection is in a bad state. Various calls, such as theIsValid
method may be called if supported on a driver that will prevent bad connections from poisoning the pool. However, right now, a driver still has to make a decision to return an interesting error or to get retry logic.See denisenkom/go-mssqldb#586
I propose that throughout
database/sql
we useerrors.Is
rather then a direct comparison todriver.ErrBadConn
.The text was updated successfully, but these errors were encountered: