Replace loop.call_later and loop.add_callback with background tasks added to Server. #6603
Merged
Replace loop.call_later and loop.add_callback with background tasks added to Server. #6603
Conversation
… unawaited coroutine warning
…call_later it's very easy to accidentally call "await group.call_soon(set_flag)" which is always wrong, this is especially bad because some type checkers will warn you that you didn't await your awaitables here also this prevents issues like "task = group.call_soon(set_flag); ... await task" where it's easy to confuse a cancellation coming from asyncio.current_task().cancel() and task.cancelled() which should be handled differently
delayed already has a meaning in dask so we should come up with a new name before making it public
this seems to have some difficult to understand consequences and should be handled in dask#6548
Member
Author
|
seemed to fail with #4498 last time |
Member
Author
|
Tests / test (ubuntu-latest, 3.8, not ci1) : #6045 |
Member
Author
|
I think this PR should be squash merged |
Contributor
Unit Test ResultsSee test report for an extended history of previous test failures. This is useful for diagnosing flaky tests. 15 files ± 0 15 suites ±0 10h 7m 49s ⏱️ + 2h 59m 38s For more details on these failures, see this check. Results for commit fc2f7e1. ± Comparison against base commit 7a0649a. ♻️ This comment has been updated with latest results. |
…the finished event to prevent hangs
fjetter
approved these changes
Jun 23, 2022
Member
|
Thank you @graingert and @hendrikmakait ! Really looking forward to having this 🎉 |
2 tasks
Collaborator
|
This PR has caused a major performance degradation in CI: #6632 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #6359
#6478 with conflicts fixed and a few suggestions applied
This PR introduces a
TaskGroupclass that encapsulates scheduling behavior behindcall_soonandcall_latermethods and allows gracefully shutting down all its tasks at once with atimeout.Outside of scope: