Skip to content

Conversation

svlandeg
Copy link
Member

@svlandeg svlandeg commented Oct 1, 2025

Recently, our CI broke after the release of AnyIO 4.11.0.

In the syncify function implementation, we are relying on some internals of anyio:

       current_async_module = (
            getattr(threadlocals, "current_async_backend", None)
            or
            # TODO: remove when deprecating AnyIO 3.x
            getattr(threadlocals, "current_async_module", None)
        )

Then when current_async_module is not None, we decide we're in an async context.

In agronholm/anyio#973 however, these internals were changed.

As such, we should now be checking threadlocals.current_token instead.

@svlandeg svlandeg marked this pull request as ready for review October 1, 2025 12:17
@tiangolo tiangolo added bug Something isn't working and removed internal labels Oct 1, 2025
@tiangolo tiangolo merged commit 88ed75e into fastapi:main Oct 1, 2025
32 checks passed
@svlandeg svlandeg deleted the fix/anyio_compat branch October 1, 2025 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants