From 8e6f8ea99c20b267e3132b5947a585bb027a7a03 Mon Sep 17 00:00:00 2001 From: Joshua Oreman Date: Thu, 18 Apr 2024 20:59:09 -0600 Subject: [PATCH 1/2] Run towncrier and bump version to 0.14.1 for release --- docs/source/history.rst | 27 +++++++++++++++++++++++++++ newsfragments/143.bugfix.rst | 3 --- newsfragments/146.misc.rst | 1 - trio_asyncio/_version.py | 2 +- 4 files changed, 28 insertions(+), 5 deletions(-) delete mode 100644 newsfragments/143.bugfix.rst delete mode 100644 newsfragments/146.misc.rst diff --git a/docs/source/history.rst b/docs/source/history.rst index 7414aba6..f4cbbbf9 100644 --- a/docs/source/history.rst +++ b/docs/source/history.rst @@ -5,6 +5,33 @@ Release history .. towncrier release notes start +trio-asyncio 0.14.1 (2024-04-18) +-------------------------------- + +Bugfixes +~~~~~~~~ + +- ``TrioExecutor.submit()``, which implements calls to + :meth:`asyncio.loop.run_in_executor` in a trio-asyncio program, + no longer acquires a token from its `~trio.CapacityLimiter` before + calling :func:`trio.to_thread.run_sync`. + The previous behaviour caused each worker thread to consume two tokens + rather than one, since :func:`trio.to_thread.run_sync` also acquires a token. + When many tasks called :meth:`~asyncio.loop.run_in_executor` in parallel, + this could cause a deadlock: because everyone is holding a first token, no one + can make progress by getting a second one. + (`#143 `__) + + +Miscellaneous +~~~~~~~~~~~~~ + +- Updated test suite to cope with Trio 0.25.0 and later defaulting + ``strict_exception_groups`` to ``True``. Trio 0.25.0 is now required + to run the tests, although trio-asyncio itself still supports older + versions. (`#146 `__) + + trio-asyncio 0.14.0 (2024-02-07) -------------------------------- diff --git a/newsfragments/143.bugfix.rst b/newsfragments/143.bugfix.rst deleted file mode 100644 index f7ddabec..00000000 --- a/newsfragments/143.bugfix.rst +++ /dev/null @@ -1,3 +0,0 @@ -``TrioExecutor.submit``, called from :meth:`asyncio.loop.run_in_executor`, no longer acquires a token from its `~trio.CapacityLimiter` before calling `~trio.to_thread.run_sync` (which already does its own ``acquire()``). - -The previous behaviour led to a double-acquire, leading each worker thread to require two tokens to run instead of one. Tasks could get stuck having acquired the first token but unable to acquire the second as part of `~trio.to_thread.run_sync`, leading to a deadlock. \ No newline at end of file diff --git a/newsfragments/146.misc.rst b/newsfragments/146.misc.rst deleted file mode 100644 index 5176c658..00000000 --- a/newsfragments/146.misc.rst +++ /dev/null @@ -1 +0,0 @@ -Updated test suite to cope with Trio 0.25.0 and later defaulting ``strict_exception_groups`` to ``True``. Trio 0.25.0 is now required to run the tests, although trio-asyncio itself still supports older versions. \ No newline at end of file diff --git a/trio_asyncio/_version.py b/trio_asyncio/_version.py index 7aff89c3..b320d43b 100644 --- a/trio_asyncio/_version.py +++ b/trio_asyncio/_version.py @@ -1,3 +1,3 @@ # This file is imported from __init__.py and exec'd from setup.py -__version__ = "0.14.0+dev" +__version__ = "0.14.1" From 032f47070abe98f418e135d0519b449f6d4812dd Mon Sep 17 00:00:00 2001 From: Joshua Oreman Date: Thu, 18 Apr 2024 21:55:29 -0600 Subject: [PATCH 2/2] Bump version to 0.14.1+dev post release --- trio_asyncio/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trio_asyncio/_version.py b/trio_asyncio/_version.py index b320d43b..e9a1a0d2 100644 --- a/trio_asyncio/_version.py +++ b/trio_asyncio/_version.py @@ -1,3 +1,3 @@ # This file is imported from __init__.py and exec'd from setup.py -__version__ = "0.14.1" +__version__ = "0.14.1+dev"