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..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.0+dev" +__version__ = "0.14.1+dev"