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
database/sql: closing connection due to driver.ErrBadConn hangs (locked) #29765
Comments
/cc @kardianos It looks familiar to the issue reported recently: #29483 |
Can you reproduce without SQL mock? |
I tried with go-sql-driver/mysql (shutdown MySQL server), but it fails with: [mysql] 2019/01/26 21:43:22 packets.go:36: unexpected EOF |
I don't think this is a problem with |
@kardianos |
Not really. The MySQL issue sounds like the MySQL server didn't like that sequence of commands or something and killed the connection. Unsure. It depends on how certain aspects are handled. The deadlock on the gomock sounds like a completly different issue where it makes a different assumption that is potentially invalid. They both could be bugs. But I have no reason to believe this is a bug with database/sql. The differences in errors actually point to the issue being with the driver. Feel free to look into the implementations and show me where I'm incorrect. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
with go1.11.4 darwin/amd64
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
See implementation here: https://github.com/mtojek/go-sqlmock-errbadconn/blob/master/err_bad_conn_test.go
I tried to return driver.ErrBadConn while the INSERT was executed. For ease of testing I used https://github.com/DATA-DOG/go-sqlmock .
What did you expect to see?
Test case passing.
What did you see instead?
Test case hanging.
The text was updated successfully, but these errors were encountered: