-
Notifications
You must be signed in to change notification settings - Fork 128
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
from_thread.run(_sync)?
does not set sniffio on asyncio
#523
Comments
At least for sync callbacks in asyncio this is an issue I also ran into and wanted to solve by detecting asyncio as backend if we were running a sync task directly in sniffIO. Would be interested in either this solution or mine going forward |
@tapetersen i think python-trio/sniffio#36 would still not fix this in all cases. even if sniffio properly detected asyncio callbacks that aren't part of a task, sniffio won't run that detection code if |
This also fixes a deadlock when using start_blocking_portal("asyncio") on a non-asyncio async backend known to sniffio. Fixes agronholm#523.
This also fixes a deadlock when using start_blocking_portal("asyncio") on a non-asyncio async backend known to sniffio. Fixes agronholm#523.
This also fixes a deadlock when using start_blocking_portal("asyncio") on a non-asyncio async backend known to sniffio. Fixes agronholm#523.
This also fixes a deadlock when using start_blocking_portal("asyncio") on a non-asyncio async backend known to sniffio. Fixes agronholm#523.
note that
from_thread.run(_sync)?
does set sniffio on trio, however.this causes a few bugs:
from_thread.run(_sync)?
fails when used to call sniffio-dependent functions when theto_thread
worker is running a non-asyncio async backend known to sniffio (i.e. trio, curio, or (situationally) trio-asyncio) and the thread that started the worker is on asyncio.reproducer: bc3cc49.
because
BlockingPortal._spawn_task_from_thread
shares its underlying implementation withfrom_thread.run_sync
on asyncio, using aBlockingPortal
that was started bystart_blocking_portal("asyncio")
in a non-asyncio async backend known to sniffio deadlocks.reproducer: cd9deb1.
The text was updated successfully, but these errors were encountered: