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

[3.8 regression] Deadlock with async_to_syncsync_to_asyncasync_to_synccreate_tasksync_to_async #492

Open
andersk opened this issue Feb 5, 2025 · 0 comments · May be fixed by #493

Comments

@andersk
Copy link
Contributor

andersk commented Feb 5, 2025

This code, minimized from the Zulip server, worked in asgiref 3.7.2, but deadlocks in 3.8.0, 3.8.1, and current main (abc69a0). A Git bisection implicates d920c3c as the first broken commit:

import asyncio

from asgiref.sync import async_to_sync, sync_to_async


async def inner() -> asyncio.Task[None]:
    return asyncio.create_task(sync_to_async(print)("inner"))


async def main() -> None:
    task = await sync_to_async(async_to_sync(inner))()
    await task


async_to_sync(main)()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant