mirror of
https://github.com/kemko/nomad.git
synced 2026-01-03 17:05:43 +03:00
filtering failed batch allocs
This commit is contained in:
@@ -231,11 +231,12 @@ func (s *GenericScheduler) process() (bool, error) {
|
||||
// re-placed.
|
||||
func (s *GenericScheduler) filterCompleteAllocs(allocs []*structs.Allocation) []*structs.Allocation {
|
||||
filter := func(a *structs.Allocation) bool {
|
||||
// Allocs from batch jobs should be filtered when their status is failed so that
|
||||
// they will be replaced. If they are dead but not failed, they
|
||||
// Allocs from batch jobs should be filtered when their status is failed
|
||||
// so that they will be replaced. If they are complete but not failed, they
|
||||
// shouldn't be replaced.
|
||||
if s.batch {
|
||||
return a.ClientStatus == structs.AllocClientStatusFailed
|
||||
return a.TerminalStatus() &&
|
||||
a.ClientStatus != structs.AllocClientStatusComplete
|
||||
}
|
||||
|
||||
// Filter terminal, non batch allocations
|
||||
|
||||
Reference in New Issue
Block a user