-
-
Notifications
You must be signed in to change notification settings - Fork 627
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
Pool can't create new connections after connectionLimit is hit and the connections have been closed #764
Comments
thanks for taking time to debug this @hallh ! I'll try to review your comment some time this weekend |
I wonder if this is what is causing me to get errors. I have noticed the last few weeks that after my program has been running for awhile I will get the following error: I put in some debug code to see if my query was wrong, but my query is correct. I am now wondering if it meant the .query of conn.query (where conn is my connection from pool.getConnection). |
any progress? |
The fork from @hallh seems to be working for me to deal with the dead pool connection problem. But I wonder if there will be any side effects by applying that workaround. @sidorares it would be great if you can make some time to take a look, Thanks. |
Actually spoke too early, the fork from @hallh doesn't solve the dead pool connection problem. For the time being I am using a very simple workaround to query ( Edit 1: It turns out the cause of my connection pool depleted problem is because I forgot to call Edit 2: Sorry I have to make one more edit, fixing the |
Possibly related to #683
I've run into an issue where using a Pool eventually blocks the client from creating new connections to MySQL. The issue is triggered when a
connectionLimit
is set and otherwise default settings.From what I can tell, the issue happens when the
connectionLimit
has been reached, and all the original connections have since been closed. It doesn't matter whether it's the client or the server closing them.The closed connections are being released, but not removed from the connection pool. If you try to get a new connection after the pool's last connection has been closed, the
getConnection
callback will wait in queue, effectively stalling forever until an already-closed connection becomes available.There's a script here to trigger the issue.
Tested against:
The check here prevents closed connections from being removed from the pool. Which means the pool ends up being full of dead connections.
The
connection._closing
is being set here. This goes both for callingclose()
on the connection, and if MySQL aborts the connection.By commenting out the
return
as shown in my fork, the connection will be cleaned up.I don't mind doing a proper fix and PR, but need some more information on the intended behavior, and the reason for this
if (connection._closing)
check.H
The text was updated successfully, but these errors were encountered: