Skip to content

Commit

Permalink
System jobs without evals are running too
Browse files Browse the repository at this point in the history
  • Loading branch information
schmichael committed Jul 3, 2017
1 parent 3f50e71 commit cd9da16
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
8 changes: 1 addition & 7 deletions nomad/state/state_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -2130,14 +2130,8 @@ func (s *StateStore) getJobStatus(txn *memdb.Txn, job *structs.Job, evalDelete b
return structs.JobStatusDead, nil
}

if hasEval {
// At least one completed eval
return structs.JobStatusRunning, nil
}

// Pending until at least one eval has completed
return structs.JobStatusPending, nil

return structs.JobStatusRunning, nil
}

// The job is dead if all the allocations and evals are terminal or if there
Expand Down
1 change: 1 addition & 0 deletions nomad/state/state_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1635,6 +1635,7 @@ func TestStateStore_JobsByScheduler(t *testing.T) {

for i := 0; i < 10; i++ {
job := mock.SystemJob()
job.Status = structs.JobStatusRunning
sysJobs = append(sysJobs, job)

err := state.UpsertJob(2000+uint64(i), job)
Expand Down

0 comments on commit cd9da16

Please sign in to comment.