-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[PR #3733/6b0bc4ef backport][3.13] Fix connector not waiting for connections to close #11074
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
CodSpeed Performance ReportMerging #11074 will not alter performanceComparing Summary
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 3.13 #11074 +/- ##
=======================================
Coverage 98.24% 98.24%
=======================================
Files 130 130
Lines 41612 41664 +52
Branches 2286 2291 +5
=======================================
+ Hits 40880 40933 +53
Misses 557 557
+ Partials 175 174 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Backport to 3.11: 💚 backport PR created✅ Backport PR branch: Backported as #11076 🤖 @patchback |
Backport to 3.12: 💚 backport PR created✅ Backport PR branch: Backported as #11077 🤖 @patchback |
What do these changes do?
This PR fixes an issue where
BaseConnector.close()
would return immediately without waiting for connections to actually close. This is a partial backport of #3733 that includes only the bug fix without any breaking API changes.The fix ensures that
close()
properly waits for all connection closures to complete by:proto.closed
futures from connections being closedasyncio.gather()
to wait for all closures to completeAre there changes in behavior for the user?
No breaking changes. The
close()
method will now properly wait for connections to close as expected, which is the correct behavior. The method continues to return an awaitable that emits a deprecation warning if not awaited.Note: When using the connector as a non-async context manager (deprecated pattern), the issue of not waiting for connections to close still remains. This is because
__exit__
calls_close()
synchronously and cannot await the connection closures. Users should use the async context manager pattern (async with
) instead. We cannot remove the sync context manager in 3.x as that would be a breaking change.Related issue number
Partial backport of #3733
fixes #1925 fixes #3736
Checklist
CONTRIBUTORS.txt
CHANGES/
folde