Skip to content
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

fixes leaking connections in _connect_addr #468

Merged
merged 2 commits into from
Nov 19, 2019

Conversation

hexrain
Copy link
Contributor

@hexrain hexrain commented Jul 23, 2019

Short summary
I've discovered that inner coroutine passed to asyncio.wait_for function may not be canceled even though CancelledError is raised.

Since there is no references to protocol or transport objects – that connection will leak forever.

I've found rather dirty way to deal with it. How can it be improved?

Detailed information can be found here:
https://bugs.python.org/issue37658
#467
https://stackoverflow.com/questions/57163025/socket-leak-with-wait-for-in-asyncio-with-python3-6-and-python3-7

@1st1 1st1 merged commit 926f483 into MagicStack:master Nov 19, 2019
@1st1
Copy link
Member

1st1 commented Nov 19, 2019

Thank you!

elprans added a commit that referenced this pull request Aug 16, 2020
`asyncio.wait_for()` currently has a bug where it raises a
`CancelledError` even when the wrapped awaitable has completed.
The upstream fix is in python/cpython#37658.  This adds a workaround
until the aforementioned PR is merged, backported and released.

Fixes: #467
Fixes: #547
Related: #468
Supersedes: #548
elprans added a commit that referenced this pull request Aug 16, 2020
`asyncio.wait_for()` currently has a bug where it raises a
`CancelledError` even when the wrapped awaitable has completed.
The upstream fix is in python/cpython#21894.  This adds a workaround
until the aforementioned PR is merged, backported and released.

Fixes: #467
Fixes: #547
Related: #468
Supersedes: #548
elprans added a commit that referenced this pull request Aug 16, 2020
`asyncio.wait_for()` currently has a bug where it raises a
`CancelledError` even when the wrapped awaitable has completed.
The upstream fix is in python/cpython#21894.  This adds a workaround
until the aforementioned PR is merged, backported and released.

Co-authored-by: Adam Liddell <git@aliddell.com>
Fixes: #467
Fixes: #547
Related: #468
Supersedes: #548
elprans added a commit that referenced this pull request Aug 27, 2020
`asyncio.wait_for()` currently has a bug where it raises a
`CancelledError` even when the wrapped awaitable has completed.
The upstream fix is in python/cpython#21894.  This adds a workaround
until the aforementioned PR is merged, backported and released.

Co-authored-by: Adam Liddell <git@aliddell.com>
Fixes: #467
Fixes: #547
Related: #468
Supersedes: #548
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.

2 participants