Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed TaskGroup and CancelScope exit issues on asyncio #774

Merged
merged 33 commits into from
Sep 21, 2024
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
278d4b6
WIP fix for #695
agronholm Apr 5, 2024
437c507
WIP: debugging issue #695
agronholm May 9, 2024
d5cc818
WIP
agronholm Aug 24, 2024
d80af79
Tests pass on 3.9
agronholm Aug 26, 2024
a0baae7
Merge branch 'master' into fix-695
agronholm Aug 26, 2024
8e3eeb1
Dropped Python 3.8 support
agronholm Aug 27, 2024
903bc71
Dropped Python 3.8 support
agronholm Aug 27, 2024
fc63721
Merge branch 'master' into fix-695
agronholm Aug 27, 2024
c0a8222
Fixed subprocess finalization on cancellation
agronholm Aug 27, 2024
9bd3c5e
Simplified the uncancellation logic
agronholm Aug 28, 2024
2cd17af
Fixed the last failing test
agronholm Aug 29, 2024
388af89
Added changelog note
agronholm Aug 29, 2024
bed20dc
Merge branch 'master' into fix-695
agronholm Aug 29, 2024
5266431
Merge branch 'master' into fix-695
agronholm Aug 31, 2024
d19b506
Merge branch 'master' into fix-695
agronholm Sep 1, 2024
c03fc1d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 1, 2024
23e687c
Added the test case from #698
agronholm Sep 2, 2024
7a6b1b0
Merge branch 'master' into fix-695
agronholm Sep 2, 2024
3a90e74
Added new failing test case
agronholm Sep 2, 2024
ce5ddb0
Merge branch 'master' into fix-695
agronholm Sep 5, 2024
947c56e
All tests pass now
agronholm Sep 8, 2024
986baf5
Merge branch 'master' into fix-695
agronholm Sep 8, 2024
f1b2738
Enabled uvloop to be used in the test suite on Python 3.13
agronholm Sep 8, 2024
f9a1e1a
Merge branch 'master' into fix-695
agronholm Sep 8, 2024
9bce41c
Merge branch 'master' into fix-695
agronholm Sep 12, 2024
3435c72
Fixed inconsistent uncancellation by asyncio cancel scopes
agronholm Sep 12, 2024
6eca825
Fixed another cancel scope issue
agronholm Sep 14, 2024
ab5ebb8
Fixed TaskGroup swallowing native cancellation exceptions
agronholm Sep 14, 2024
093e065
Merge branch 'master' into fix-695
agronholm Sep 19, 2024
c082056
Updated the changelog
agronholm Sep 19, 2024
9081213
Fixed CancelScope not uncancelling if it was exited with a real excep…
agronholm Sep 19, 2024
2f68895
Fixed unbalanced parentheses
agronholm Sep 20, 2024
15a4bcb
Update tests/test_taskgroups.py
agronholm Sep 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", pypy-3.10]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", pypy-3.10]
include:
- os: macos-latest
python-version: "3.8"
python-version: "3.9"
- os: macos-latest
python-version: "3.12"
- os: windows-latest
python-version: "3.8"
python-version: "3.9"
- os: windows-latest
python-version: "3.12"
runs-on: ${{ matrix.os }}
Expand Down
11 changes: 11 additions & 0 deletions docs/versionhistory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ This library adheres to `Semantic Versioning 2.0 <http://semver.org/>`_.

**UNRELEASED**

- Dropped support for Python 3.8
- Improved the performance of ``anyio.Lock`` and ``anyio.Semaphore`` on asyncio (even up
to 50 %)
- Added the ``fast_acquire`` parameter to ``anyio.Lock`` and ``anyio.Semaphore`` to
Expand All @@ -29,6 +30,12 @@ This library adheres to `Semantic Versioning 2.0 <http://semver.org/>`_.
- Fixed ``to_process.run_sync()`` failing to initialize if ``__main__.__file__`` pointed
to a file in a nonexistent directory
(`#696 <https://github.com/agronholm/anyio/issues/696>`_)
- Fixed 100% CPU use on asyncio while waiting for an exiting task group to finish while
said task group is within a cancelled cancel scope
(`#695 <https://github.com/agronholm/anyio/issues/695>`_)
- Fixed cancel scopes on asyncio not reraising ``CancelledError`` on exit while the
enclosing cancel scope has been effectively cancelled
(`#698 <https://github.com/agronholm/anyio/issues/698>`_)
- Fixed ``AssertionError: feed_data after feed_eof`` on asyncio when a subprocess is
closed early, before its output has been read
(`#490 <https://github.com/agronholm/anyio/issues/490>`_)
Expand All @@ -43,6 +50,10 @@ This library adheres to `Semantic Versioning 2.0 <http://semver.org/>`_.
- Fixed support for Linux abstract namespaces in UNIX sockets that was broken in v4.2
(#781 <https://github.com/agronholm/anyio/issues/781>_; PR by @tapetersen)
- Fixed ``KeyboardInterrupt`` (ctrl+c) hanging the asyncio pytest runner
- Fixed asyncio task groups not yielding control to the event loop at exit if there were
no child tasks to wait on
- Fixed inconsistent task uncancellation with asyncio cancel scopes belonging to a
task group when said task group has child tasks running

**4.4.0**

Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ classifiers = [
"Typing :: Typed",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
requires-python = ">= 3.8"
requires-python = ">= 3.9"
dependencies = [
"exceptiongroup >= 1.0.2; python_version < '3.11'",
"idna >= 2.8",
Expand Down Expand Up @@ -128,7 +127,7 @@ show_missing = true
[tool.tox]
legacy_tox_ini = """
[tox]
envlist = pre-commit, py38, py39, py310, py311, py312, py313, pypy3
envlist = pre-commit, py39, py310, py311, py312, py313, pypy3
skip_missing_interpreters = true
minversion = 4.0.0

Expand Down
Loading