-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Description
Issue description
When I operate MySQL concurrently, the number of actually created connections is greater than the set maximum number of connections. Is my usage wrong? Or is the connection leaked somewhere?
Example code
// fuzz_conn_test.go
func FuzzConn(f *testing.F) {
db, _ := sql.Open("mysql", "dsn")
db.SetMaxOpenConns(2)
db.SetMaxIdleConns(2)
db.SetConnMaxIdleTime(10 * time.Second)
db.SetConnMaxLifetime(10 * time.Second)
f.Fuzz(func(t *testing.T, a int) {
go func() {
r, _ := db.Query("select sleep(10)")
r.Close()
}()
})
}Error log
Configuration
Driver version (or git SHA): v1.8.0
Go version: go version go1.21.8 windows/amd64
Server version: MySQL 5.7+
Metadata
Metadata
Assignees
Labels
No labels
