-
Notifications
You must be signed in to change notification settings - Fork 129
fix(aiomysql): avoid wrapping pooled connections multiple times #1553
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
Conversation
|
I'll handle moving the tests for this to the right place and making sure they're working, thanks for finding this though. Really curious how |
|
Reproduction details Agent 10.17.0 / aiomysql 0.2.0 / Python 3.12 Sample log : After this patch, the same load no longer produces RecursionErrors and the service stays healthy. |
For reference, aiomysql’s pool implementation reuses the same connection object pulled from the free queue:
|
5f6234f to
ee8b864
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1553 +/- ##
==========================================
- Coverage 81.76% 81.76% -0.01%
==========================================
Files 207 207
Lines 23946 23948 +2
Branches 3796 3797 +1
==========================================
+ Hits 19580 19581 +1
Misses 3100 3100
- Partials 1266 1267 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Overview
AsyncConnectionWrapperRecursionError: maximum recursion depth exceededtests/agent_unittests/test_database_aiomysql.py) that simulates a pool returning the same connection twiceRelated Github Issue
None.
Related forum thread: https://support.newrelic.com/s/hubtopic/aAXPh000000EHIjOAO/recursionerror-when-new-relic-python-agent-instruments-aiomysql-still-happening
Testing
All tests passed including the new test I added