Skip to content

[PR #11100/947247fd backport][3.12] Fix spurious "Future exception was never retrieved" warnings for connection lost errors #11101

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

patchback[bot]
Copy link
Contributor

@patchback patchback bot commented May 31, 2025

This is a backport of PR #11100 as merged into master (947247f).

What do these changes do?

This PR fixes spurious "Future exception was never retrieved" warnings that occur when connections are lost (e.g., SSL shutdown timeouts, network errors) and the connector is not immediately closed.

The fix marks the exception on the ResponseHandler.closed future as retrieved after setting it, since the exception is always propagated through other means (via the waiter). This prevents Python from logging unnecessary warnings about unretrieved exceptions.

Are there changes in behavior for the user?

No functional changes. Users will no longer see spurious "Future exception was never retrieved" warnings in their logs when connections are lost.

Related issue number

This issue was introduced by #3733 (backported as #11074), which added proper connection closure waiting but exposed these futures that may not be awaited until the connector is closed.

@bdraco bdraco enabled auto-merge (squash) May 31, 2025 05:02
Copy link

codecov bot commented May 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.25%. Comparing base (d4e62ef) to head (8f6a77f).
Report is 1 commits behind head on 3.12.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             3.12   #11101   +/-   ##
=======================================
  Coverage   98.24%   98.25%           
=======================================
  Files         130      130           
  Lines       41765    41777   +12     
  Branches     2294     2294           
=======================================
+ Hits        41034    41046   +12     
  Misses        557      557           
  Partials      174      174           
Flag Coverage Δ
CI-GHA 98.13% <100.00%> (+<0.01%) ⬆️
OS-Linux 97.87% <100.00%> (+<0.01%) ⬆️
OS-Windows 95.48% <100.00%> (-0.01%) ⬇️
OS-macOS 97.08% <100.00%> (+<0.01%) ⬆️
Py-3.10.11 96.85% <100.00%> (+<0.01%) ⬆️
Py-3.10.17 97.36% <100.00%> (+<0.01%) ⬆️
Py-3.11.12 97.54% <100.00%> (+0.04%) ⬆️
Py-3.11.9 97.03% <100.00%> (+<0.01%) ⬆️
Py-3.12.10 97.90% <100.00%> (+<0.01%) ⬆️
Py-3.13.3 97.88% <100.00%> (-0.01%) ⬇️
Py-3.9.13 96.75% <100.00%> (+<0.01%) ⬆️
Py-3.9.22 97.22% <100.00%> (-0.04%) ⬇️
Py-pypy7.3.16 84.81% <100.00%> (+0.28%) ⬆️
VM-macos 97.08% <100.00%> (+<0.01%) ⬆️
VM-ubuntu 97.87% <100.00%> (+<0.01%) ⬆️
VM-windows 95.48% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

codspeed-hq bot commented May 31, 2025

CodSpeed Performance Report

Merging #11101 will not alter performance

Comparing patchback/backports/3.12/947247fd4aa2954a746c3a8c183bb7acceb8c3cd/pr-11100 (8f6a77f) with 3.12 (8efe84e)

Summary

✅ 59 untouched benchmarks

@bdraco bdraco disabled auto-merge May 31, 2025 05:13
@bdraco bdraco merged commit 497df2e into 3.12 May 31, 2025
31 checks passed
@bdraco bdraco deleted the patchback/backports/3.12/947247fd4aa2954a746c3a8c183bb7acceb8c3cd/pr-11100 branch May 31, 2025 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant