diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-09-22 16:58:35 (GMT) |
---|---|---|
committer | Pablo Galindo <pablogsal@gmail.com> | 2022-10-24 15:45:38 (GMT) |
commit | 56145c696323d6fa5c346d6bcf3a7b7ff4410cef (patch) | |
tree | f82318c5254a4a4dd8248fb55301e6fd9753cec7 /Misc | |
parent | 67f5d24e44cd53f23b814a735718cfca36f553c5 (diff) | |
download | cpython-56145c696323d6fa5c346d6bcf3a7b7ff4410cef.zip cpython-56145c696323d6fa5c346d6bcf3a7b7ff4410cef.tar.gz cpython-56145c696323d6fa5c346d6bcf3a7b7ff4410cef.tar.bz2 |
gh-90155: Fix bug in asyncio.Semaphore and strengthen FIFO guarantee (GH-93222)
The main problem was that an unluckily timed task cancellation could cause
the semaphore to be stuck. There were also doubts about strict FIFO ordering
of tasks allowed to pass.
The Semaphore implementation was rewritten to be more similar to Lock.
Many tests for edge cases (including cancellation) were added.
(cherry picked from commit 24e03796248ab8c7f62d715c28156abe2f1c0d20)
Co-authored-by: Cyker Way <cykerway@gmail.com>
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/Library/2022-05-25-15-57-39.gh-issue-90155.YMstB5.rst | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2022-05-25-15-57-39.gh-issue-90155.YMstB5.rst b/Misc/NEWS.d/next/Library/2022-05-25-15-57-39.gh-issue-90155.YMstB5.rst new file mode 100644 index 0000000..8def769 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-05-25-15-57-39.gh-issue-90155.YMstB5.rst @@ -0,0 +1 @@ +Fix broken :class:`asyncio.Semaphore` when acquire is cancelled. |