-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Separate Continuation after Task Failure and Success Determination #12530
Comments
This could also apply to hooks (and exit handlers), which have a bit of a similar confusion among them. |
Perhaps this could be something like a |
That seems like an acceptable solution if we change the
tasks:
- name: optional-setup
template: setup-template
ignoreFailure: true # This task's failure won't affect the workflow's final status
- name: critical-analysis
template: analysis-template
ignoreFailure: false # This task's failure will cause the workflow to fail
- name: cleanup
template: cleanup-template
depends: "optional-setup.Succeeded || optional-setup.Failed"
ignoreFailure: true # Cleanup runs regardless of previous task success but also doesn't affect final status I think this would be a breaking change though if people expected |
Also for others here is a workaround: Provide the task step that has the depends logic - name: reportquality
arguments:
parameters:
- name: b_status
value: "{{tasks.B.status}}" [ "{{inputs.parameters.b_status}}" = "Failed" ] && { echo "B task step failed. exiting with non-zero status."; exit 1; } || true |
Wait a minute, isn't this already possible with the |
My understanding is that it doesn't work with depends and I tried continueOn without depends and using dependencies and it still did not work. |
Oh right, you're trying to do the opposite of
That makes more sense why it would need a breaking change. This is unlikely to happen though, and I'm not sure that that behavior is more intuitive; arguably it is less intuitive. A non-breaking way to do this would be to introduce a new top-level Workflow flag, similar to
You might be able to do this by adding But I think this still wouldn't achieve your goal, since you need the opposite of |
Yeah it seems like a simple ask at first. This is coming from a need to upload reports with the results of previous tasks (If they failed or not) and fail the entire workflow if the reports contain issues. |
Exactly my use case. (In Jenkins, such components are called "publishers"; here is a list of related use cases) |
Description
I've encountered a situation in Argo Workflows where, when using a Directed Acyclic Graph (DAG) with FailFast set to true, there's a need to allow a workflow to continue even after a task fails, but still have the workflow recognize the failure at the end. Currently, by using
depends: "B.Succeeded || B.Failed"
in a task, we can ensure that a subsequent task (like taskC
) will run even if taskB
fails. However, this approach also leads to the workflow being marked as successful, despite the failure of taskB
(assuming no other tasks fail).This behavior is not explicitly documented in the enhanced depends logic documentation, and we need to distinguish between continuing a workflow after a task failure and the final success/failure determination of the workflow itself.
Related Slack conversation.
Suggested Enhancement
I propose an enhancement where there's a clear separation between allowing a workflow to continue after a task failure and determining the overall success or failure of the workflow. This could potentially be an additional attribute or a modification in the depends logic.
Use Case
This enhancement would be beneficial in scenarios where certain tasks are critical but not blockers for the continuation of the workflow. Teams would have the flexibility to allow the workflow to proceed with subsequent tasks, while still being able to flag the workflow as failed if any critical task doesn't succeed.
Expected Behavior
With this enhancement, users should be able to:
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: