-
Notifications
You must be signed in to change notification settings - Fork 2.3k
autoreconnection fails with prepared statements #98
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
Comments
This is part of the database/sql package connection pooling. Hence auto-reconnecting is available out of the box in this driver. |
I must be missing something because I get a "driver: bad connection" error when the mysql connection has been severed and a new SQL query is sent. The driver doesn't auto-reconnect. |
Yes, this seems to be a bug or a problem with the query. Can you share the query you are sending? |
And please check the according |
Here is my test code:
Here is what I'm seeing in the terminal:
|
It seems like the server (or the OS) kills the connection: |
Yes, I'm killing the connection manually to test the autoreconnection.
In this case, the EOF is logged, but a retry happens right away. |
Sorry, I missed your comment. |
thanks |
FYI, I filed a Golang bug too: https://code.google.com/p/go/issues/detail?id=5718 |
The bug was accepted and put on the "later" queue, is they something that could be done at the driver level to work around this issue? Or maybe do you have a suggestion on how to work around this issue in my own code? Thanks |
I'm still tapping in the dark where exactly in the code this bug is caused. I'll let you know as soon as I have a driver or client side workaround. |
Hey, I am also seeing the message "packets.go:31: EOF" Could I help in any way? |
The EOF error can have a lot of reasons, it just means that the connection is broken. Also, in the current master branch the EOF error should appear less often. |
Seen this on Go1.1.2 on Linux x64 (Ubuntu 12.04). |
I'm also seeing this on Ubuntu 12.10 go 1.1.2 |
Are you using v1.0 (the current |
mine is the 'go get' version. I'll check out the git master - thanks :-) |
Same behavior for my Go application. In my case, the error trace is coming from line 36, but otherwise looks to be a similar issue with idle connections not correctly reestablishing after a couple hours when it comes time to process more queries. |
@mcandre This issue was not about |
Issue tracker is not forum to ask such questions. |
From I could see, this driver doesn't support autoreconnection. Did I miss something?
I know that mymysql supports this feature, but I'd prefer to stick to your driver if possible.
The text was updated successfully, but these errors were encountered: