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

Handle mysql timeouts #16

Closed
felixge opened this issue Sep 16, 2010 · 3 comments
Closed

Handle mysql timeouts #16

felixge opened this issue Sep 16, 2010 · 3 comments

Comments

@felixge
Copy link
Collaborator

felixge commented Sep 16, 2010

Detect stale connections and automatically re-connect.

@CrabDude
Copy link

If anyone else runs into this problem, this is a good stopgap:

// Reconnect every 5 minutes
// I believe default mysql-timeout is 10 minutes
setInterval(function() {
    client.end();
    client.connect();
}, 300000);

@felixge
Copy link
Collaborator Author

felixge commented Oct 14, 2010

The client will now automatically reconnect whenever a connection ends that was not supposed to be ending. This should fix this issue for most parts.

See: 81edd83

I might spend some more time on implementing exponential backoff and things like that.

@sigMacity
Copy link

First, thank you for all your efforts.

Just wondering, is exponential backoff on the roadmap. Various cloud providers are recommending it as a recovery strategy.

dveeden pushed a commit to dveeden/mysql that referenced this issue Jan 31, 2023
dveeden pushed a commit to dveeden/mysql that referenced this issue Jan 31, 2023
dveeden pushed a commit to dveeden/mysql that referenced this issue Jan 31, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants