Message393336
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. |
|
Date |
User |
Action |
Args |
2021-05-09 20:15:37 | nmatravolgyi | set | recipients:
+ nmatravolgyi, ods, asvetlov, chris.jerdonek, yselivanov, tvoinarovskyi, crowbarz |
2021-05-09 20:15:37 | nmatravolgyi | set | messageid: <1620591337.56.0.685195718114.issue42130@roundup.psfhosted.org> |
2021-05-09 20:15:37 | nmatravolgyi | link | issue42130 messages |
2021-05-09 20:15:36 | nmatravolgyi | create | |
|