Skip to content
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

[Feature Request] Populate contextvars for threaded activities #263

Closed
cretz opened this issue Jan 30, 2023 · 0 comments · Fixed by #268
Closed

[Feature Request] Populate contextvars for threaded activities #263

cretz opened this issue Jan 30, 2023 · 0 comments · Fixed by #268
Labels
enhancement New feature or request

Comments

@cretz
Copy link
Member

cretz commented Jan 30, 2023

Is your feature request related to a problem? Please describe.

Currently we are calling https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.run_in_executor but we are not propagating the contextvars.

Describe the solution you'd like

Since there is no way with run_in_executor and we don't want to use to_thread as suggested at python/cpython#78195 because it doesn't use a custom executor, we need to just populate the context ourselves. This of course won't work with process pool executor.

@cretz cretz added the enhancement New feature or request label Jan 30, 2023
cretz added a commit to cretz/temporal-sdk-python that referenced this issue Feb 7, 2023
@cretz cretz mentioned this issue Feb 7, 2023
@cretz cretz closed this as completed in #268 Feb 8, 2023
cretz added a commit that referenced this issue Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant