Closed
Description
Issue description
mysql.Connect is leaving open connections in cases when the context is canceled very quickly. Specifically, the error branch for watchCancel() in connector.go should call mc.cleanup() but doesn't:
// Call startWatcher for context support (From Go 1.8)
mc.startWatcher()
if err := mc.watchCancel(ctx); err != nil {
return nil, err
}
defer mc.finish()
We've reproduced this leak internally under heavy load, and that adding a call to mc.cleanup()
fixes it.
Configuration
Driver version (or git SHA): c45f530
Go version: go version go1.13 linux/amd64
Server version: MySQL 5.7
Server OS: E.g. Debian 8.1 (Jessie), Windows 10
Metadata
Metadata
Assignees
Labels
No labels