[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2021-05-24 Thread Denis S. Otkidach
Denis S. Otkidach added the comment: Re: msg393586 > See my comment in the PR for a suggestion about an alternative structure for > wait_for, which may avoid this gap and hence prevent the leak (but I have not > tested it!) Unfortunately this didn't close the gap, so the leak persisted. I

[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2021-05-14 Thread nmatravolgyi
nmatravolgyi added the comment: I did a little research on how the `wait_for` could be improved. There are four alternate implementations you can find here: https://github.com/Traktormaster/wait-for2/blob/issue37658/wait_for2/impl.py The repository (on the linked branch) has tox set-up and

[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2021-05-13 Thread Adam Liddell
Adam Liddell added the comment: Wrapping every resource allocating call like that is what we were trying to avoid, since it makes wait_for go from a simple one-line helper to something you have to be very careful with. Conceptually, a user should expect that wait_for should behave the exact

[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2021-05-13 Thread Denis S. Otkidach
Denis S. Otkidach added the comment: The original problem can be fixed by wrapping await into try-except block: ``` async def create_connection(ssl_obj): loop = asyncio.get_event_loop() connector = loop.create_connection(MyEchoClientProtocol, '127.0.0.1', 5000, ssl=ssl_obj)

[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2021-05-13 Thread Denis S. Otkidach
Change by Denis S. Otkidach : -- pull_requests: +24738 pull_request: https://github.com/python/cpython/pull/26097 ___ Python tracker ___

[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2021-05-13 Thread Adam Liddell
Adam Liddell added the comment: Some discussion leading up to that change is here https://github.com/MagicStack/asyncpg/pull/548 and in the issues it links. -- ___ Python tracker

[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2021-05-13 Thread Denis S. Otkidach
Denis S. Otkidach added the comment: The current solutions doesn't look correct. It swallows cancelling causing task to hang: https://bugs.python.org/issue42130 . Proposed test case calls cancel for inner future and set_result for outer task in the same loop step. The old (prior to this

[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2020-10-24 Thread Chris Jerdonek
Chris Jerdonek added the comment: Issue #42130 that was recently filed appears related to this change. -- nosy: +chris.jerdonek ___ Python tracker ___

[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2020-08-26 Thread Elvis Pranskevichus
Change by Elvis Pranskevichus : -- pull_requests: +21078 pull_request: https://github.com/python/cpython/pull/21969 ___ Python tracker ___

[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2020-08-26 Thread Yury Selivanov
Yury Selivanov added the comment: New changeset 6e1954cd8286e083e7f8d09516d91b6b15769a4e by Miss Islington (bot) in branch '3.8': bpo-37658: Fix asyncio.wait_for() to respect waited task status (GH-21894) (#21965)

[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2020-08-26 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 9de6be4e2ae605a1deb6fa72d5c5f66b07817e4c by Miss Islington (bot) in branch '3.9': bpo-37658: Fix asyncio.wait_for() to respect waited task status (GH-21894) (GH-21964)

[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2020-08-26 Thread miss-islington
Change by miss-islington : -- pull_requests: +21075 pull_request: https://github.com/python/cpython/pull/21965 ___ Python tracker ___

[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2020-08-26 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +21074 pull_request: https://github.com/python/cpython/pull/21964 ___ Python tracker

[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2020-08-26 Thread Yury Selivanov
Yury Selivanov added the comment: New changeset a2118a14627256197bddcf4fcecad4c264c1e39d by Elvis Pranskevichus in branch 'master': bpo-37658: Fix asyncio.wait_for() to respect waited task status (#21894) https://github.com/python/cpython/commit/a2118a14627256197bddcf4fcecad4c264c1e39d

[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2020-08-16 Thread aaliddell
Change by aaliddell : -- nosy: +aaliddell ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2020-08-15 Thread Elvis Pranskevichus
Change by Elvis Pranskevichus : -- keywords: +patch nosy: +Elvis.Pranskevichus nosy_count: 3.0 -> 4.0 pull_requests: +21013 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21894 ___ Python tracker

[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2019-07-23 Thread Nikita Ilyasov
Nikita Ilyasov added the comment: server example: https://gist.github.com/hexrain/bc92aa70eebc229365f0ce4bcccf7fc4 -- ___ Python tracker ___

[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2019-07-23 Thread Nikita Ilyasov
New submission from Nikita Ilyasov : In some cases `asyncio.wait_for` can lead to socket leak. Condensed example: ```python async def _create_connection(timeout=60, ssl_obj): loop = asyncio.get_event_loop() connector = loop.create_connection(MyEchoClientProtocol, '127.0.0.1', 5000,