Skip to content
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

use of closed network connection error #1078

Closed
waichee opened this issue Apr 1, 2020 · 3 comments
Closed

use of closed network connection error #1078

waichee opened this issue Apr 1, 2020 · 3 comments

Comments

@waichee
Copy link

waichee commented Apr 1, 2020

Issue description

We are seeing a few instances of the following errors when using the MySQL driver with sqlx

 write tcp <some_ip>-><some_ip>3306: use of closed network connection

Under what situations would this error be thrown? Is this expected?

Example code

	sqlDB := sqltrace.OpenDB(connector)
	sqlxDB := sqlx.NewDb(sqlDB, "mysql")
       var mystruct []MyStruct
        // query := a valid sql query
       err := conn.SelectContext(ctx, &mystruct, query) 

Error log

If you have an error log, please paste it here.

Configuration

Driver version (or git SHA): v1.5.0

Go version: run go version in your console 1.13.1

Server version: MySQL 5.7 (Aurora 2)

Server OS: Linux

@methane
Copy link
Member

methane commented Apr 1, 2020

Any other errors before the error?

Other error can close the connection and leads this error. In this case, you should ignore this error and focus on the other errors.

@waichee
Copy link
Author

waichee commented Apr 1, 2020

ah right i see. Theres some context cancelled errors. So the context being closed potentially could results in concurrent queries to throw this error?

@methane
Copy link
Member

methane commented Apr 2, 2020

So the context being closed potentially could results in concurrent queries to throw this error?

I don't know. If you want we investigate your issue, please provide a reproducible sample.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants