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

support get_worker() and worker_client() in async tasks #7844

Merged
merged 4 commits into from
May 31, 2023

Conversation

graingert
Copy link
Member

@graingert graingert commented May 18, 2023

Closes #5513

  • Tests added / passed
  • Passes pre-commit run --all-files

@graingert graingert changed the title support get_worker() in async tasks support get_worker() and worker_client() in async tasks May 18, 2023
@graingert
Copy link
Member Author

this will also need a test for get_worker() in Actors

@graingert
Copy link
Member Author

this is like #5517 but only sets the contextvar when running user tasks

distributed/client.py Outdated Show resolved Hide resolved
yield client

if separate_thread:
rejoin()
Copy link
Member Author

@graingert graingert May 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

previously this didn't rejoin if there was an exception in with worker_client():

@graingert graingert marked this pull request as ready for review May 18, 2023 13:33
@graingert graingert requested a review from fjetter as a code owner May 18, 2023 13:33
@github-actions
Copy link
Contributor

Unit Test Results

See test report for an extended history of previous test failures. This is useful for diagnosing flaky tests.

       26 files  ±    0         26 suites  ±0   14h 48m 29s ⏱️ - 24m 51s
  3 607 tests +    4    3 498 ✔️ +    3     105 💤 ±  0  4 +1 
44 631 runs   - 959  42 510 ✔️  - 905  2 117 💤  - 53  4  - 1 

For more details on these failures, see this check.

Results for commit 8e092cd. ± Comparison against base commit e887fde.

@hendrikmakait hendrikmakait added the needs review Needs review from a contributor. label May 31, 2023
Copy link
Member

@hendrikmakait hendrikmakait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @graingert!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review Needs review from a contributor.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot call worker_client() from an asynchronous function
2 participants