-
-
Notifications
You must be signed in to change notification settings - Fork 650
feat: gracefully end pool connections #3148 #3776
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
feat: gracefully end pool connections #3148 #3776
Conversation
…tions to be gracefully closed (sidorares#3148)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3776 +/- ##
==========================================
+ Coverage 89.25% 89.83% +0.57%
==========================================
Files 86 86
Lines 13583 13596 +13
Branches 1584 1606 +22
==========================================
+ Hits 12124 12214 +90
+ Misses 1459 1382 -77
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Thanks, @dstankovd! After the |
I'm trying to figure out the hanging test runs, but I'm having trouble reproducing this issue. On my local machine, the full test suite runs successfully against MySQL v8.3.0. I also tried using deno with the setup from this failing job, and all tests completed without hanging. Since the tests pass in a replicated environment, do you have any thoughts on what could be causing this flakiness in the CI? As a side note, I did find some tests that hangwhen using MariaDB 11.4. I believe this is an unrelated issue that's not connected to this PR, and I'll look into it separately. |
@dstankovd @wellwelwel first of all thank you for your time in maintaining this project! After reading on this issue, I think the previous PR https://github.com/sidorares/node-mysql2/pull/3180/files is a much better solution. Much cleaner and avoid another confusing Any chance we can get @sidorares approval on that instead? My database log is also flooded with the "aborted connection" error messages so I would love to have this issue fixed. Thanks! |
@dstankovd, just checking and confirming that the error is in the new test (test/integration/test-pool-release-idle-connection-graceful-end.test.cjs). @trungdq88, I'm fine with either solution, but since the previous one removes a depreciation, it's interesting to consider @sidorares's point, especially for architectural reasons. Whereas in this current solution, since it's a new flag, it is more flexible to be merged before. |
Hey @wellwelwel, finally managed to reproduce the issue locally and I've reorganized the new tests a bit and changed them to depend on process exit to validate the outcome, that appears to have fixed the test execution for me. Hopefully the CI will pass too. :) As for the @trungdq88's suggestion - I also prefer the solution in the previous pull request but, if the compatibility with mysql is a must, then it's a no-go. Generally, I don't think that changing the Either way, for now I'm keen to have the logs clear from the "aborted connection" warning so I'd gladly use the work-around implementation in this pull request. I can open a new issue to further discuss the possibility of actually changing the |
Updating just to bring in the #1752 changes. Regarding changing the |
Thanks again, @dstankovd! It's already available in the |
Related to: #3148
When Pool._removeIdleTimeoutConnections() is executed and an idle connection is selected for removal (regardless of the conditions) the stream is just ended without notifying the MySQL server. This leads to warnings being logged in the SQL error log.
This pull requests add additional config option that would gracefully close the pool connection.