Skip to content

Commit

Permalink
Prevent Job Statuses from being calculated twice
Browse files Browse the repository at this point in the history
#8435 introduced atomic eval
insertion iwth job (de-)registration. This change removes a now obsolete
guard which checked if the index was equal to the job.CreateIndex, which
would empty the status. Now that the job regisration eval insetion is
atomic with the registration this check is no longer necessary to set
the job statuses correctly.
  • Loading branch information
drewbailey committed Jan 11, 2021
1 parent f52cab8 commit f9f01d2
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions nomad/state/state_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -4427,9 +4427,6 @@ func (s *StateStore) setJobStatus(index uint64, txn *txn,

// Capture the current status so we can check if there is a change
oldStatus := job.Status
if index == job.CreateIndex {
oldStatus = ""
}
newStatus := forceStatus

// If forceStatus is not set, compute the jobs status.
Expand Down

0 comments on commit f9f01d2

Please sign in to comment.