-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connect is leaking connections when context is quickly canceled #1023
Comments
mherr-google
added a commit
to mherr-google/mysql
that referenced
this issue
Nov 1, 2019
Fix connection leak caused by rapid context cancellation (go-sql-driver#1023)
I'll send a pull request fixing this shortly. |
mherr-google
added a commit
to mherr-google/mysql
that referenced
this issue
Nov 1, 2019
Regression test for go-sql-driver#1023.
5 tasks
mherr-google
added a commit
to mherr-google/mysql
that referenced
this issue
Nov 1, 2019
fix go vet warning for possibly-unused cancel (go-sql-driver#1023)
5 tasks
tz70s
pushed a commit
to tz70s/mysql
that referenced
this issue
Sep 5, 2020
tz70s
pushed a commit
to tz70s/mysql
that referenced
this issue
Sep 5, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
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
The text was updated successfully, but these errors were encountered: