-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
bpo-34014: Added support of contextvars for BaseEventLoop.run_in_executor #9688
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Blocking this to prevent accidental merge.]
As per the bpo discussion: our goal is to provide a new API for working with threadpools and processpools. If we end up having their design ready in a few months we might want to revisit this PR. If not, we'll likely merge this PR as is.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
@1st1 thanks for the update! Is there any PEP/API spec/ideas available? |
master was just merged |
I have made the requested changes; please review again. |
Thanks for making the requested changes! @1st1: please review the changes made to this pull request. |
I'm still not sure about this -- we can't make contextvars work with process pools. :( Need to design a new API for 3.9. You can champion that; first we need to start a discussion. We'll need to assess the current situation, what are the alternatives (curio, trio, twisted), and what's the best possible api we can design for asyncio given its constraints. |
@1st1 seems using something rather than https://github.com/python/cpython/blob/master/Lib/asyncio/base_events.py#L811 what about to restrict same way using not and silently apply propagation of then we can point this changes to |
Yeah, that's another problem, as we didn't do so in 3.7/3.8. @asvetlov what do you think? |
process pool executor is forbidden as default because things like DNS resolving doesn't work with it IIRC. Sorry, I don't follow what the proposal is? Please elaborate silently apply propagation of contextvars part |
Helps with setting the current client in worker while deserializing. Implementation referenced from python/cpython#9688
Helps with setting the current client in worker while deserializing. Implementation referenced from python/cpython#9688
any news about this ? |
@asvetlov is there an alternative to this ? |
Take a look at |
An updated version of #8035
according to latest discussion on https://bugs.python.org/issue34014
If proposed solution looks good I'll start updating related docs changes
https://bugs.python.org/issue34014