-
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
Closed connections stuck in CLOSE_WAIT #47
Comments
Another data point. It appears if I call destroy() in a callback from end() that this issue goes away.
But I'm not sure why this would be necessary. There's some discussion on stackoverflow about mysqld settings that could affect this. I'm using default values for wait_timeout and interactive_timeout (28800 seconds, or 8 minutes). My suspicion is that CLOSE_WAIT lingers for 8 minutes and then mysqld hangs up. Not sure if that helps at all. |
Can you try to add: https://github.com/felixge/node-mysql/blob/master/lib/mysql/client.js#L66 |
Hi Felix, Yes, that seems to work. Thanks. You want to make that change, or should I issues a pull request? Thanks! -- James |
Well, unfortunately this causes another test to fail:
I won't have time to look into this right away, so if you have some time to investigate - that'd be great : ). |
hey there, Ok, I'll try to take a closer look in a day or two! -- James |
This should be fixed in https://github.com/felixge/node-mysql/tree/refactoring (to be released as 0.9.2 soon). The new version no longer has a connect method, and instead automatically connects as needed. --fg |
This may be related to #43 - the symptom in my app was that I ran out of file descriptors. lsof revealed that I was leaking mysql connections.
I have traced the origins of this issue to changes made between the npm 0.6.0 and 0.7.0 releases. 0.7.0 and 0.8.0 appear to have this issue.
Here's some examples (my app code is unchanged across these runs):
Downgrade to 0.6.0:
I will see if I can figure out what changed between releases. My guess is the conn.end() behavior has changed. From the documentation it sounds like end() attempts to gracefully close the connection. Perhaps another packet needs to be sent after the COM_QUIT?
thank you
-- James
The text was updated successfully, but these errors were encountered: