-
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
mysql does not reconnect if connection was closed #670
Comments
Duplicate of #657 |
Summary: If your program start showing "invalid connection" after #302 (26471af), You must not rely on old behavior. You must close connection from client side, before idle timeout. |
I use "auto-commit" and there is only "read-only" queries :( I think DB.SetConnMaxLifetime(%time less than mysql server idle timeout%), right ? |
But driver can't know your query is read only.
You can retry by yourself, but I recommend short lifetime strongly. It
saves you from many troubles.
On 2017年9月21日(木) 23:03 Bulat Gaifullin ***@***.***> wrote:
I use "auto-commit" and there is only "read-only" queries :(
I think DB.SetConnMaxLifetime(), right ?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#670 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAMLqL8M0hG8pcw9nEV_ClF24k7LC0XHks5skmyagaJpZM4PfLDE>
.
--
Inada Naoki <songofacandy@gmail.com>
|
Ok. |
Issue description
if connection has been closed by idle timeout, further requests fails with error 'invalid connection'
seems like this behaviour was introduced by commit 26471af.
because the same code works on version 3955978
Configuration
Driver version (or git SHA):
7785c74
Go version: run
go version
in your consolego version go1.9 darwin/amd64
Server version: E.g. MySQL 5.6, MariaDB 10.0.20
Ver 5.7.16-10 for osx10.12 on x86_64 (Homebrew)
Server OS: E.g. Debian 8.1 (Jessie), Windows 10
OSX 10.12
The text was updated successfully, but these errors were encountered: