Skip to content

Commit

Permalink
Update scheduler/generic_sched.go
Browse files Browse the repository at this point in the history
Co-Authored-By: Michael Schurter <mschurter@hashicorp.com>
  • Loading branch information
tgross and schmichael committed Nov 26, 2019
1 parent 11879bb commit 6f98b61
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scheduler/generic_sched.go
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,9 @@ func getSelectOptions(prevAllocation *structs.Allocation, preferredNode *structs
selectOptions := &SelectOptions{}
if prevAllocation != nil {
penaltyNodes := make(map[string]struct{})

// If alloc failed, penalize the node it failed on to encourage
// rescheduling on a new node.
if prevAllocation.ClientStatus == "failed" {
penaltyNodes[prevAllocation.NodeID] = struct{}{}
}
Expand Down

0 comments on commit 6f98b61

Please sign in to comment.