Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upcontextvars.Context not activated for connection_made() #305
Comments
|
Context not being restored for protocol_factory call is what causing problems. python's asyncio copies current context (by creating callback handle) when creating uvloop simply calls |
|
Yes, this is a bug. |
|
This PR needs to be considered as part of this issue, basically #306 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
PYTHONASYNCIODEBUGin env?: YesCode works as expected on asyncio loop (
varhas value in handler) but fails with uvloop. I tracked difference up toconnection_made():There is similar difference in
UVStreamHandler._on_listen:uvloop/uvloop/handles/streamserver.pyx
Line 67 in 35f8250
protocol_handler()is being called without context activation, while with asyncio it receives context. I'm not sure if this can be the root cause.