-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Ignore protocol exceptions after it is closed #6321
Conversation
155744c
to
b046b2c
Compare
Codecov Report
@@ Coverage Diff @@
## master #6321 +/- ##
=======================================
Coverage 93.31% 93.32%
=======================================
Files 103 103
Lines 30369 30374 +5
Branches 2731 2730 -1
=======================================
+ Hits 28340 28347 +7
+ Misses 1852 1850 -2
Partials 177 177
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed that this fixes #4526
Backport to 3.8: 💔 cherry-picking failed — conflicts found❌ Failed to cleanly apply 58da337 on top of patchback/backports/3.8/58da3373a21211bbde21f1393475e73f53a5671d/pr-6321 Backporting merged PR #6321 into master
🤖 @patchback |
Backport to 3.9: 💔 cherry-picking failed — conflicts found❌ Failed to cleanly apply 58da337 on top of patchback/backports/3.9/58da3373a21211bbde21f1393475e73f53a5671d/pr-6321 Backporting merged PR #6321 into master
🤖 @patchback |
Backporting doesn't make sense, |
Issue
I've recently started to experience strange ssl exceptions with
aiohttp 4+
(master branch) with the following message:Reproducer
Code to reproduce the error.
Description
After some digging I found out a related issue in python bug tracker:
https://bugs.python.org/issue39951
It describes possible scenario for this type of SSL exception to happen:
close notify
.close notify
.In
aiohttp
this exception happens whenBaseConnector._release
is called withshould_close=True
aiohttp/aiohttp/connector.py
Lines 628 to 633 in d149eff
After execution of this branch
protocol
is on its way to be removed by GC. But if theprotocol.connection_lost
is called with exception before the removal (which is exactly what is happening) theprotocol.closed
future will store this exception.aiohttp/aiohttp/client_proto.py
Lines 73 to 79 in d149eff
During the removal of the
protocol
object, the following exception will be produced:Future exception was never retrieved
.Solution
I solved it by setting the result of
self.closed
toNone
explicitly during the_release
call withshould_close=True
.Related issue number
Fixes #4526
Checklist
CONTRIBUTORS.txt
CHANGES
folder<issue_id>.<type>
for example (588.bugfix)issue_id
change it to the pr id after creating the pr.feature
: Signifying a new feature..bugfix
: Signifying a bug fix..doc
: Signifying a documentation improvement..removal
: Signifying a deprecation or removal of public API..misc
: A ticket has been closed, but it is not of interest to users.