[issue43991] asyncio lock does not get released after task is canceled

2021-05-03 Thread Alexander Niederbühl
Alexander Niederbühl added the comment: That makes sense, thanks! -- stage: -> resolved status: open -> closed ___ Python tracker ___

[issue43991] asyncio lock does not get released after task is canceled

2021-05-03 Thread Jonathan Schweder
Jonathan Schweder added the comment: a.niederbuehl tasks are free of context, meaning that the task does not know what was done inside it, and by consequence is impossible to know when or not release a lock. This is by design and normally in these cases you need to be aware of the lock, by

[issue43991] asyncio lock does not get released after task is canceled

2021-04-30 Thread Alexander Niederbühl
New submission from Alexander Niederbühl : If a task gets canceled while holding a lock, the lock is not automatically released. Is that expected, it seems like it could cause a deadlock? Failing test adapted from Lib/test/test_asyncio/test_locks.py (commit 6bd9288b80): def