Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idempotent Dispatch Key for Parameterized Jobs #10641

Closed
alexmunda opened this issue May 22, 2021 · 2 comments · Fixed by #10930
Closed

Idempotent Dispatch Key for Parameterized Jobs #10641

alexmunda opened this issue May 22, 2021 · 2 comments · Fixed by #10930
Labels
theme/batch Issues related to batch jobs and scheduling type/enhancement

Comments

@alexmunda
Copy link
Contributor

alexmunda commented May 22, 2021

Firstly, I want to say that Nomad is awesome and keep up the good work 😄

Proposal

It would be nice to be able to specify an idempotency key when dispatching a parameterized job to ensure that only 1 instance of the batch job corresponding to the supplied key can be running at a time. Perhaps it could be a special meta key (shoutout to @nickethier and @tgross for the meta idempotency idea):

meta := map[string]string{
   "idempotency_key": "terraform-run-123"
}

_, _, err = client.Jobs().Dispatch("terraform", meta, bytes, nil)

Use-cases

End Goal: If a job is dispatched with a supplied idempotency key, there should only be 1 child job running at a given time that matches the key, regardless of how many times the job is dispatched for the same key during the running child job's lifetime.

An example use case is to ensure that only 1 Terraform run matching a supplied key is running at a given time.

Attempted Solutions

None yet 😄

@schmichael
Copy link
Member

Fixed by #10806 so closing! Thanks for the issue and PR @alexmunda!

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
theme/batch Issues related to batch jobs and scheduling type/enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants