-
-
Notifications
You must be signed in to change notification settings - Fork 720
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
Garbage collect Scheduler Instances during testing #6281
Conversation
Unit Test Results 16 files ±0 16 suites ±0 8h 13m 38s ⏱️ + 28m 2s For more details on these failures, see this check. Results for commit 11de7b7. ± Comparison against base commit 8411c2d. ♻️ This comment has been updated with latest results. |
…g instance references are removed
…osed_before_client
with pristine_loop() as loop: | ||
with check_process_leak(check=processes): | ||
with check_instances() if instances else nullcontext(): | ||
with check_instances() if instances else nullcontext(): |
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.
The IOLoop needs to be cleaned up first, otherwise callbacks on the loop like Scheduler.remove_worker
will hold onto Scheduler instances and cause check_instances
to fail.
I'm not aware of any drawbacks to this ordering.
s = next(iter(Scheduler._instances)) | ||
import objgraph | ||
|
||
objgraph.show_backrefs([s], filename="scheduler.png") |
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.
The objgraph import should be removed upon PR approval
@@ -6697,7 +6697,7 @@ async def get_story(self, keys=()): | |||
|
|||
transition_story = story | |||
|
|||
def reschedule(self, key=None, worker=None): | |||
def reschedule(self, key=None, worker=None, stimulus_id=None): |
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.
There's a smaller PR addressing this here: #6307
@@ -30,7 +30,7 @@ async def test_profile_plot(c, s, a, b): | |||
assert len(p.source.data["left"]) >= 1 | |||
|
|||
|
|||
@gen_cluster(client=True, clean_kwargs={"threads": False}) | |||
@gen_cluster(client=True, clean_kwargs={"threads": False, "instances": False}) |
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.
instance checks are disabled on a variety of tests largely due to #6308.
Garbage collecting Scheduler objects is useful, but secondary relative to clearing up TaskStates and their expensive run_spec attributes.
We should log an issue that tracks re-enabling them.
Closes #6250
pre-commit run --all-files