Closed gschaffner closed 1 month ago
The underlying bug is that TaskInfo.has_pending_cancellation
is returning false positives with shields on asyncio. The false positive causes MemoryObjectSendStream.send
to think that the receiver has a pending cancellation (even though the receiver is shielded), so it ignores the receiver:
Things to check first
[X] I have searched the existing issues and didn't find my bug already reported there
[X] I have checked that my bug is still present in the latest release
AnyIO version
master (439951d9babf7615f0720fd43c93c2a695549bd4)
Python version
3.12.5 (CPython)
What happened?
Some applications started deadlocking recently when updating AnyIO to 4.4.0. It bisects to #735.
(Aside: Apologies I did not follow-up in the discussions about #728 in May. I got unexpectedly busy at the time :/ )
How can we reproduce the bug?
(This reproducer could be made smaller but I think it would sacrifice readability)