Closed suhjohn closed 1 year ago
There is a lot of magic inside those two functions - when you wrap them this way, the inside async_to_sync function will attempt to break out and use the outside event loop, so it will behave differently than if you just wrapped it inside one level.
Unless you can create a very simple test case that shows a bug in asgiref, though, this is likely just a bad async interaction/deadlock in your code, so I'm going to close this.
Uvicorn -> Asgi -> synchronous view` -> sync_to_async wrapped function that issues asyncio.gather to 3rd party api.
I'm seeing a lot of 500 errors on the asyncio.gather due to aiohttp calls failing with timeouts. None of this happens when I perform the same using Gunicorn -> Wsgi.
Is there some magic that I might have to know that might be causing this issue?