GH-86296: Fix for asyncio.wait_for() swallowing cancellation, and add tests#98607
GH-86296: Fix for asyncio.wait_for() swallowing cancellation, and add tests#98607twisteroidambassador wants to merge 7 commits into
Conversation
|
In particular, these are the expected failures: |
Sorry, something went wrong.
|
The latest commit is enough to fix #86296, however it still fails one of the new tests added. Specifically, with Now the question is: is this over-specification? If so, we should remove this test and call it a day. |
Sorry, something went wrong.
The existing method of setting identical timeout / sleep lengths is not reliable.
This means swallowing the inner future's result / exception, if they are set simultaneously with the external cancellation.
|
I have changed Also changed new tests to match. Now all tests should pass. |
Sorry, something went wrong.
|
I need to put this back into my review queue! |
Sorry, something went wrong.
|
FWIW, there already have been
trying to tackle this issue. I'll state it again, I think this is a really nasty bug comparable to a function in the std lib swallowing a |
Sorry, something went wrong.
✅ Deploy Preview for python-cpython-preview canceled.
|
Sorry, something went wrong.
|
AFAIK, this is superseded by #96764 which fixed the issue and tests have been added for each case. The tests being added here seems much harder to understand than whose which are already added. |
Sorry, something went wrong.
|
@kumaraditya303 with the difference that this PR could be ported back to Python 3.10 while the one you linke depends on |
Sorry, something went wrong.
|
I’m not very keen on having to learn yet again all the edge cases of wait_for. Maybe we can just leave 3.10 alone? |
Sorry, something went wrong.
Nor am I, there is only one bug fix release left for 3.10 and I don't want to risk introducing any issue in a stable branch. |
Sorry, something went wrong.
|
So let's just close this. |
Sorry, something went wrong.
edited by bedevere-bot
LoadingUh oh!
There was an error while loading. Please reload this page.
Copy link Copy MarkdownSorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.