proposal: workflow concurrency control #12757
Labels
area/controller
Controller issues, panics
area/spec
Changes to the workflow specification.
area/synchronization
`parallelism` configurations and other synchronization
type/feature
Feature request
Current state
Users have no built-in way of limiting simultaneous runs of identical workflows if they wish to do so.
This is because mutexes & semaphores in Argo only prevent multiple N concurrent runs, but do not limit at the workflow definition level. If they did work it would only work simply in the event that the user would like to delay execution (a queue) rather than cancel one of the runs.
User story
As an Argo user I want the ability to enable a limit for the number of concurrent runs of an identical workflow definition so I can achieve any of the following benefits:
Examples:
Proposal
CronWorkflows already have concurrencyPolicy matching that of a native CronJob.
We would add a
concurrencyPolicy
field in the spec of a Workflow (it would also work if specified int a WorkflowTemplate spec consumed via workflowTemplateRef):Valid policies are
Allow
,Forbid
andReplace
. These are the same concurrencyPolicies as available in CronWorkflow/CronJob.Allow
: Would do the current behavior and is the defaultForbid
: Would prevent a new workflow from running, and a new workflow would be stopped.Replace
: Would replace an older workflow with the new one, which would terminate the existing workflow.As there is no way of knowing the other workflows to group against the optional field
concurrencyMatchLabels
. Without this field theconcurrencyPolicy
would do nothing because no other workflows would be in the group.The match block is like many other systems and would allow label matching to find other workflows for which this concurrency policy applies.
This would silently do nothing for WorkflowTemplates which are not consumed via workflowTemplateRef in the same way as other similar fields like volumes do.
Message from the maintainers:
Love this enhancement proposal? Give it a 👍. We prioritize the proposals with the most 👍.
The text was updated successfully, but these errors were encountered: