argoproj / argoproj/argo-workflows

`argo stop` option to respect `continueOn`

Open
#2,870 0 comments 0 reactions 0 assignees View on GitHub
area/cli area/shutdown
Dominant language
Go
Stars
17k
Forks
3.7k
Avg merge
1d 20h
Merged PRs (30d)
138

Description

# Summary

`argo stop`, possibly by default and possibly with an option, should still execute steps that would run subsequently upon failure of the currently-running steps to continue. This allows "manual exit handlers" to still function in addition to explicitly-specified exit handlers.

# Motivation

`argo stop` provides a softer alternative to `argo terminate` by still running exit handlers, which is helpful if they are needed to perform cleanup tasks. However, it only does so for exit handlers explicitly defined as such, not those implemented with, say, `continueOn: {failed: True}`. This is problematic because exit handlers don't mesh well (#2831) with WorkflowTemplates. In my particular case, as I mentioned at the above issue, that incompatibility has led me to translate my explicit exit handlers into manual exit handlers. It would be nice to be able to continue using `argo stop`.

In general, I would shy away from building functionality like `argo stop` that depends on explicitly denoting exit handlers, given that it's ["superfluous" and "essentially a convenience feature"](https://github.com/argoproj/argo/pull/1716#issuecomment-555631825), especially as [more continuation tools](https://github.com/argoproj/argo/pull/1839) become available.

# Proposal

There should be an option like `argo stop --continue` (don't love the name, please come up with a better one) which simply ends fails all currently running steps. If there are later steps that would continue upon failure of those steps, they continue as normal. Ideally this would be made the default behavior, so the option would be necessary if you wanted to _not_ run the following steps.

---

**Message from the maintainers**:

If you wish to see this enhancement implemented please add a 👍 reaction to this issue! We often sort issues this way to know what to prioritize.

Contributor guide

Open the contributing guide

Research direction

Start at the `argo stop` command and trace how it handles currently running steps, explicit exit handlers, and `continueOn`. Define and test the proposed continuation behavior, including the possible `--continue` option, so later steps that continue after failure run as intended without breaking existing stop behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
cli, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.