-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Refactor scheduler package to enable preemption for batch/service jobs #5545
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.
LGTM, one nit and a design question, but neither are blocking
scheduler/generic_sched.go
Outdated
@@ -501,6 +501,7 @@ func (s *GenericScheduler) computePlacements(destructive, place []placementResul | |||
AllocatedResources: resources, | |||
DesiredStatus: structs.AllocDesiredStatusRun, | |||
ClientStatus: structs.AllocClientStatusPending, | |||
|
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.
nit: rm extra newline?
package scheduler | ||
|
||
// NewGenericStack constructs a stack used for selecting service placements | ||
func NewGenericStack(batch bool, ctx Context) *GenericStack { |
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.
Do we potentially want to have a way to modify the stack, rather than duping the whole setup? (mostly worried about duplicate work when introducing other new scheduler things that could easily be forgotten to be also PR'd to ENT)
This PR fixes a panic that result when preempter considers a new alloc that's part of the plan in https://github.com/hashicorp/nomad/pull/5545/files#diff-4b31728e0a7a88025f9d7c26ecce3e5eR152 . This is observed in #5777 . |
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
No functional changes, this moves some code around for batch/service job preemption