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

fix: Enable the workflow created by a wftmpl to retry after manually stopped #11355

Merged
merged 1 commit into from
Jul 14, 2023

Conversation

TongKangheng
Copy link
Contributor

@TongKangheng TongKangheng commented Jul 14, 2023

…ally after manually stopped

No, I just met a problem in my work, but I made no issue but fix it myself because of time constraints

Motivation

Most of the users I am responsible for use workflow-templates to create workflows. However, there is a problem that has been bothering us: after the workflows created through the workflow templates are manually stopped, when retrying the failed node (because of the Stop operation) and all subsequent nodes will be skipped. Here is an example:

After manually stopped:
image

Ater manually retried:
image

Modifications

After carefully reading the relevant code, we finally realized that in the FormulaRetryWorkflow function, newWF.Status.StoredWorkflowSpec.Shutdown should be set to an empty string instead of keeping the shutdown information.

Verification

The following is a sample workflow template file:

metadata:
  name: clf-test-retry
  namespace: argo
spec:
  templates:
    - name: echo
      inputs:
        parameters:
          - name: message
      outputs: {}
      metadata: {}
      container:
        name: ''
        image: alpine:3.7
        command:
          - sleep
          - 1000s
        resources: {}
    - name: diamond
      inputs: {}
      outputs: {}
      metadata: {}
      dag:
        tasks:
          - name: A
            template: echo
            arguments:
              parameters:
                - name: message
                  value: A
          - name: B
            template: echo
            arguments:
              parameters:
                - name: message
                  value: B
            dependencies:
              - A
          - name: C
            template: echo
            arguments:
              parameters:
                - name: message
                  value: C
            dependencies:
              - A
          - name: D
            template: echo
            arguments:
              parameters:
                - name: message
                  value: D
            dependencies:
              - B
              - C
  entrypoint: diamond
  arguments: {}

You can just stop and retry the workflow when node A is running and the images in the Motivation can be reproduced.
After our fix, the workflow after retrying is as follows:
image

Signed-off-by: tongkangheng.tkh [email protected]

@terrytangyuan terrytangyuan changed the title fix: Enable the workflow created by a workflow-template to Retry norm… fix: Enable the workflow created by a wftmpl to retry after stopped Jul 14, 2023
@terrytangyuan terrytangyuan changed the title fix: Enable the workflow created by a wftmpl to retry after stopped fix: Enable the workflow created by a wftmpl to retry after manually stopped Jul 14, 2023
Copy link
Member

@terrytangyuan terrytangyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Could you sign your commits?

@terrytangyuan
Copy link
Member

Tests are failing

@TongKangheng
Copy link
Contributor Author

Thanks. Could you sign your commits?

I have done this

@terrytangyuan
Copy link
Member

Thanks. Please fix test failures.

@terrytangyuan terrytangyuan enabled auto-merge (squash) July 14, 2023 22:52
@terrytangyuan terrytangyuan merged commit bda5322 into argoproj:master Jul 14, 2023
dpadhiar pushed a commit to dpadhiar/argo-workflows that referenced this pull request May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants