-
-
Notifications
You must be signed in to change notification settings - Fork 717
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
Add check to scheduler creation in SpecCluster #4605
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.
Thanks @jacobtomlinson! In principle this check seems fine, though I'm wondering how we will encounter a case where self.scheduler
isn't None
in practice. Are you doing something like
cluster = SpecCluster(...)
cluster.scheduler = <an-existing-scheduler>
await cluster.start()
during cluster discovery?
Kinda, I had already tried setting the status to |
The |
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.
Ah, I see. Would you mind adding a comment which mentions this, or a test, to make sure we don't accidentally revert this if self.scheduler is None
check?
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.
Thanks @jacobtomlinson!
While working on cluster discovery support I found that when reconstructing a cluster scheduler and worker objects may have already been created before start is called.
This small PR adds a check and only creates the scheduler if it doesn't already exist.
This is the first step towards making
SpecCluster
declarative rather than imperative.black distributed
/flake8 distributed