This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author nmatravolgyi
Recipients asvetlov, chris.jerdonek, crowbarz, nmatravolgyi, ods, tvoinarovskyi, yselivanov
Date 2021-05-09.20:15:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1620591337.56.0.685195718114.issue42130@roundup.psfhosted.org>
In-reply-to
Content
I've also found this deficiency of asyncio.wait_for by debugging an obscure hang in an application. Back then I've quickly made an issue about it: https://bugs.python.org/issue43389

I've just closed it as duplicate, since this issue covers the same bug and has been around longer.

I'm surprised this issue has not got more attention. This definitely needs a fix. Ignoring a CancellationError is something that is heavily discouraged by the documentation in general. Silently ignoring/eating a cancellation makes this construct unreliable without good workarounds, aside from not using it.

For a specific application, this was so broken, that I had to come up with a fix in the short term. I made an asyncio.wait_for variant available as a library that fixes the problem: https://github.com/Traktormaster/wait-for2

The repository has a detailed description of the issue and the way it fixes it. It also has test cases to assert the behaviour of the builtin and the fixed wait_for construct from the library.
History
Date User Action Args
2021-05-09 20:15:37nmatravolgyisetrecipients: + nmatravolgyi, ods, asvetlov, chris.jerdonek, yselivanov, tvoinarovskyi, crowbarz
2021-05-09 20:15:37nmatravolgyisetmessageid: <1620591337.56.0.685195718114.issue42130@roundup.psfhosted.org>
2021-05-09 20:15:37nmatravolgyilinkissue42130 messages
2021-05-09 20:15:36nmatravolgyicreate