-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
random acquire connection timeout and why new connection when freeConnections exist #2246
Comments
The reason the free connection was not used is because it failed a PING. As in, in your screenshot, it shows 1 free connection available, but then when this module goes to use the connection, it will first run a PING command on the connection, and if it failed to return within |
@dougwilson Thank you for the timely response. I got your explanation, but I still have a few puzzles.
|
Unfortunately unless you can provide me a way to reproduce the issue so I can debug it, I don't know the answer to those questions. |
@dougwilson I understand but I can not provide a way to you to debug, because It is the company‘s project. I can reproduce the issue just a few times one day and it random. I will debug it on my Mac and get more log to offer to you. I hope if you have any suggestions or need the log, please let me know and I will do my best to do it. logdebug in
log
I will debug for more detail log. Are you have any advice on where to debug for more timeout log |
I've already explained why the connection was not used above. If you don't want to accept that answer, then I need more evidence to the contrary. What you just posted above re-enforce what I already said the issue was if that sequence timeout was on a PING sequence. |
@dougwilson Yes, I accept your answer. But I want to know why it is timeout when pinging because it is so strange (Always appear in the first few requests of every day). |
Gotcha. To determine why it has a timeout, you'll need to look out of your Node.js code and into either your network infrastructure or your MySQL server. |
@dougwilson I think I found the question. the MySQL connection will be recycled when idle time over 8 hours (set by My DBA colleague told me it did not send a signal to the client when the connection was recycled. their way is to check the connection on time to make the connection available by I found here is a pr it will suit for me. |
In my app, I get a few acquire timeout every day, below is code and log
Code is:
And config is
Here is log:
The text was updated successfully, but these errors were encountered: