@@ -5679,15 +5679,9 @@ func (s *StateStore) getJobStatus(txn *txn, job *structs.Job, evalDelete bool) (
5679
5679
// If there is a non-terminal allocation, the job is running.
5680
5680
hasAlloc := false
5681
5681
for alloc := allocs .Next (); alloc != nil ; alloc = allocs .Next () {
5682
- a := alloc .(* structs.Allocation )
5683
- if ! a .TerminalStatus () {
5682
+ if ! alloc .(* structs.Allocation ).TerminalStatus () {
5684
5683
return structs .JobStatusRunning , nil
5685
5684
}
5686
- // if there exists a terminal, non-reschedulable alloc,
5687
- // mark this job as possibly dead
5688
- if ! isReschedulable (a ) {
5689
- hasAlloc = true
5690
- }
5691
5685
}
5692
5686
5693
5687
evals , err := txn .Get ("evals" , "job_prefix" , job .Namespace , job .ID )
@@ -5697,18 +5691,8 @@ func (s *StateStore) getJobStatus(txn *txn, job *structs.Job, evalDelete bool) (
5697
5691
5698
5692
hasEval := false
5699
5693
for raw := evals .Next (); raw != nil ; raw = evals .Next () {
5700
- e := raw .(* structs.Evaluation )
5701
-
5702
- // Handles restarting stopped jobs and rescheduled allocs, or else they
5703
- // are briefly marked dead. We don't always want to skip these evaluations,
5704
- // like in the case of rescheduled or stopped jobs, but we handle both
5705
- // those cases in elsewhere in this function.
5706
- if e .JobModifyIndex < job .ModifyIndex {
5707
- continue
5708
- }
5709
-
5710
5694
hasEval = true
5711
- if ! e .TerminalStatus () {
5695
+ if ! raw .( * structs. Evaluation ) .TerminalStatus () {
5712
5696
return structs .JobStatusPending , nil
5713
5697
}
5714
5698
}
@@ -7421,13 +7405,6 @@ func (s *StateStore) ScalingPoliciesByIDPrefix(ws memdb.WatchSet, namespace stri
7421
7405
return iter , nil
7422
7406
}
7423
7407
7424
- func isReschedulable (a * structs.Allocation ) bool {
7425
- if a .Job .Type != structs .JobTypeService {
7426
- return false
7427
- }
7428
- return a .RescheduleTracker .RescheduleEligible (a .ReschedulePolicy (), time .Now ())
7429
- }
7430
-
7431
7408
// scalingPolicyNamespaceFilter returns a filter function that filters all
7432
7409
// scaling policies not targeting the given namespace.
7433
7410
func scalingPolicyNamespaceFilter (namespace string ) func (interface {}) bool {
0 commit comments