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
It's possible for a connection to enter a state where it is returned to
the pool with unread data in the buffer. This can happen when an
`ErrPktSync` error is encountered because the packet payload is left
unread. When the connection is taken from the pool again, any futher
queries will results in an `ErrBusyBuffer` error. The connection can be
returned to the pool multiple times before it times out, so this can
result in many, many errors.
To fix this, this commit updates the `IsValid()` method to return false
if the buffer is not empty. The `database/sql` package will use this to
decide whether or not to return the connection to the pool, so returning
false means that the connection will be discarded.
0 commit comments