-
Notifications
You must be signed in to change notification settings - Fork 44.7k
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
fix(backend): Avoid long synchronous call to block FastAPI event-loop #8429
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Background
We are doing some synchronous calls (pyro calls) on our FastAPI handler, which can potentially block the event loop and render the API unavailable.
Changes 🏗️
async
on function handlers that call pyro & don't require async calls.asyncio.to_thread
to execute pyro calls that mix with async calls.Testing 🔍
Note
Only for the new autogpt platform, currently in autogpt_platform/