-
-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
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 #98607
Conversation
twisteroidambassador
commented
Oct 24, 2022
•
edited by bedevere-bot
Loading
edited by bedevere-bot
- Issue: AsyncIO's wait_for can hide cancellation in a rare race condition #86296
In particular, these are the expected failures:
|
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. |
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. |
I need to put this back into my review queue! |
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 |
✅ Deploy Preview for python-cpython-preview canceled.
|
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. |
@kumaraditya303 with the difference that this PR could be ported back to Python 3.10 while the one you linke depends on |
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? |
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. |
So let's just close this. |