-
-
Notifications
You must be signed in to change notification settings - Fork 719
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
Cannot call worker_client()
from an asynchronous function
#5513
Comments
Thanks for reporting @orf, I'm able to reproduce. cc @gjoseph92 for visibility |
I'm actually quite confused about how asynchronous functions are scheduled. We needed to use Does this mean that workers run more than 1 async task concurrently, even if it's configured with "threads=1"? If so is there an upper bound of async tasks that can be run? If so I guess |
Yes, there is currently no bound to the number of concurrent async tasks (async tasks are assumed to be lightweight). We could add a configurable limit here if there's a good use case for one. But yeah, launching tasks from an async task doesn't run the same risk of a deadlock that launching from a synchronous task does (since the async task doesn't occupy a thread). |
What happened:
Calling
worker_client()
from an async function throws an exceptionWhat you expected to happen:
It should not throw an exception
Minimal Complete Verifiable Example:
This errors with:
Anything else we need to know?:
Most likely related to #5485
Environment:
The text was updated successfully, but these errors were encountered: