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
What version of Go are you using (go version)?
go version go1.6.2 darwin/amd64
What operating system and processor architecture are you using (go env)?
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
What did you do?
set the db.maxOpen to limit connections count.
and try to do db query when connection pool is out of free connections
What did you expect to see?
expect database/sql support connection wait timeout setting, the connection wait timeout specifies how long an db request waits to obtain a connection if there are no longer any free connections in the pool.
with this setting, we can make the db request fail fast when out of free connections
go version
)?go version go1.6.2 darwin/amd64
go env
)?GOHOSTARCH="amd64"
GOHOSTOS="darwin"
set the db.maxOpen to limit connections count.
and try to do db query when connection pool is out of free connections
expect database/sql support connection wait timeout setting, the connection wait timeout specifies how long an db request waits to obtain a connection if there are no longer any free connections in the pool.
with this setting, we can make the db request fail fast when out of free connections
according the related code block https://github.com/golang/go/blob/master/src/database/sql/sql.go#L800-L817, the db request will wait, until get an connection to return, when returned, the application may have been waiting for 10s, or longer 10min.
The text was updated successfully, but these errors were encountered: