Skip to content

Commit

Permalink
Fix a problem with connection waiters that are never awaited
Browse files Browse the repository at this point in the history
  • Loading branch information
illia-v committed Feb 9, 2020
1 parent ea8f35e commit 6805b87
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES/4560.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a problem with connection waiters that are never awaited.
1 change: 1 addition & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ Igor Alexandrov
Igor Davydenko
Igor Mozharovsky
Igor Pavlov
Illia Volochii
Ilya Chichak
Ingmar Steen
Ivan Larin
Expand Down
5 changes: 4 additions & 1 deletion aiohttp/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,10 @@ async def connect(self, req: 'ClientRequest',

raise e
finally:
if not waiters:
# `waiters` may be deleted from `self._waiters` by another
# coroutine, and `self._waiters[key]` may contain another
# deque, the later should not be deleted.
if not waiters and self._waiters[key] is waiters:
try:
del self._waiters[key]
except KeyError:
Expand Down

0 comments on commit 6805b87

Please sign in to comment.