argoproj / argoproj/argo-workflows

Retry strategy with `withParam` context could only retry failed ones, not succeded ones

Open
#9,190 5 comments 3 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
17k
Forks
3.7k
Avg merge
1d 20h
Merged PRs (30d)
138

Description

# Summary

If a template has `retryStrategy` and if one of the steps of the template has `withParam`, the following situation happens;

Let's say, we have 4 items `eg. projectIDs: [1,2,3,4]`, and we use `withParam` to make them concurrently run. 3/4 of tasks succeeded and 1/4 of tasks failed. The main template will retry this step again but with all the `projectIDs`, including previously successful ones.

If it'd retry only failed ones, then it would make more sense, IMO.

An example piece of template;

```
- name: deploy-projects-with-failover
retryStrategy:
limit: 3
backoff:
duration: "1m"
factor: 1
inputs:
parameters:
- name: projectIDs
steps:
- - name: deploy-project
template: deploy-project
withParam: "{{inputs.parameters.projectIDs}}"
arguments:
parameters:
- name: projectID
value: "{{item}}"
```

# Use Cases

I wouldn't want successful tasks to run over and over again. Currently, I am putting extra conditions to prevent any error like `if the project is deployed, skip it` Otherwise, it retries to run deploy-project with a `projectID` that was already installed.

> PS. I am aware that the deploy-project is not `idempotent` already, but I specifically would like to focus on possible improvements of `argo workflows`.

---

**Message from the maintainers**:

Love this enhancement proposal? Give it a 👍. We prioritise the proposals with the most 👍.

Contributor guide

Open the contributing guide

Research direction

No files, tests, or entry points are named. Start by tracing how retryStrategy and withParam executions are represented and retried, then review existing workflow retry tests; done means retries rerun only failed items without rerunning successful ones.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
backend, infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.