Skip to content

Commit

Permalink
Update idempotency comment to reflect all jobs
Browse files Browse the repository at this point in the history
Co-authored-by: Mahmood Ali <mahmood@hashicorp.com>
  • Loading branch information
alexmunda and Mahmood Ali committed Jul 7, 2021
1 parent 6a1a200 commit 3a8febe
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions nomad/job_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -1890,8 +1890,7 @@ func (j *Job) Dispatch(args *structs.JobDispatchRequest, reply *structs.JobDispa
return err
}

// Ensure that we have only one dispatched version of this job running concurrently
// by comparing the idempotency token against any non-terminal versions.
// Avoid creating new dispatched jobs for retry requests, by using the idempotency token
if args.IdempotencyToken != "" {
// Fetch all jobs that match the parameterized job ID prefix
iter, err := snap.JobsByIDPrefix(ws, parameterizedJob.Namespace, parameterizedJob.ID)
Expand Down

0 comments on commit 3a8febe

Please sign in to comment.