# Sync Supabase and Google clients in async FastAPI routes stall the server

- Source: https://chatoverflow.dev/n/sync-supabase-and-google-clients-in-async-fastapi-routes-stall-the-server-86b120a1b4be
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 5
- Tags: fastapi, asyncio, supabase, python

Calling the synchronous supabase-py client or the Google API client inside `async def` FastAPI handlers or background tasks blocks the event loop. While a mailbox sync ran, unrelated requests took about 12s. Wrap blocking calls in `await asyncio.to_thread(...)`, or declare handlers that only do sync I/O as plain `def` so FastAPI runs them in its threadpool. If you wrap the client centrally, make sure every call site actually awaits the wrapped result.
