Update dependency asgiref to v3.12.1 #11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "renovate/asgiref-3.x"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
==3.11.1→==3.12.1Release Notes
django/asgiref (asgiref)
v3.12.1Compare Source
Restored the previous SyncToAsync.call internal code shape, which was
relied on by some APM services. (#572)
Note, this change was available whilst maintaining the underlying fix (from
#564). It does not constitute an API stability promise. Ideally APMs are
not monkey patching internal APIs, and future changes will be made here if
needed.
v3.12.0Compare Source
AsyncToSyncno longer captures the running event loop oninstantiation. (#562)
This resolves a series of deadlocks that users experienced after asgiref 3.9.0,
particularly with pytest-asyncio. pytest-asyncio stops the event loop between
tests, and long-running unawaited futures could find themselves trying to
schedule work onto a stopped loop, and so would never complete. Ideally, code
should be structured to await long-running futures before returning, but this
change should help users experiencing issues here.
The loop is now resolved when the callable is invoked rather than when it is
created. If
async_to_syncis called from withinsync_to_async, theparent event loop is still used, as before.
The possibility of deadlock therefore remains in some nested patterns. For
example, an async function may call a long-running
sync_to_asyncfunctionthat itself uses
async_to_sync; if the outer function returns before thesync future completes, the parent event loop may already be stopped, and the
nested calls cannot be driven to completion.
This is not a bug in asgiref — the same patterns deadlock in plain asyncio. As
above, restructure your code to await the
sync_to_asyncfuture beforeexiting the driving coroutine.
Fixed an event loop deadlock when exiting
ThreadSensitiveContextwhile its executor thread was still blocked waiting on the event loop.
(#535)
Dropped support for EOL Python 3.9.
Fixed
StatelessServer.run()failing on Python 3.14, whereasyncio.get_event_loop()no longer creates an event loop if noneexists. It now uses
asyncio.run(). (#559)Fixed
Localleaking data between unrelated sync threads whensys.flags.thread_inherit_contextis enabled (Python 3.14+), so a newlystarted thread inherits a copy of the spawning thread's context. This flag is
on by default on free-threaded builds and opt-in on the regular GIL build.
Localstorage is now tagged with its owning thread and re-homed only whenasgiref intentionally moves work across threads (in
async_to_sync/sync_to_async), restoring the documented thread-local behaviour in syncthreads.
asgiref is now tested against the free-threaded builds of Python 3.13 and
3.14 in CI.
The
testsextra no longer installsmypy; a newmypyextra isavailable for type-checking the codebase.
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.