StackStorm / StackStorm/orquesta

Retries using with-items runs a retry even on objects that succeeded as well

Open
#201 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
111
Forks
44
PR merge metrics
No merged PRs in 30d

Description

We use the with-items to loop over and run an action.
If it fails for even one of them, it retries over all the items in the array again, instead of just retrying the failed ones.

For instance, if param1 was set to 1,2,3,4 in the below sample workflow:

version:                1.0
description:            Test retry workflow
input:
  - param1
  - slack_channel
tasks:
  split_list:
    action: core.noop
    next:
    - when: <% succeeded() %>
      do: print_val
      publish:
        - list_vals: <% ctx(param1).split(',') %>
  print_val:
    with: <% ctx(list_vals) %>
    action: core.local
    input :
      cmd : >
        val=<% item() %>;
        if [ $val -eq 2 ];then exit -1;fi
    retry:
      when: <% failed() %>
      count: 5
      delay: 2
    next:
      - when: <% succeeded() %>
        publish:
          - status: "SUCCESS"
      - when: <% failed() %>
        do:
          - send_failed_alert
        publish:
          - status: "FAILED"
  send_failed_alert:
    action: slack.chat.postMessage
    input:
      channel: "#<% ctx(slack_channel) %>"
      text: "ERROR: failed on param <% ctx(param1) %> failed"`

And here is the output of the run.

image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the supplied YAML workflow with param1 set to 1,2,3,4 and observe the retry behavior for the with-items action. Trace the retry and item-execution paths to determine why successful items run again; done means retries are limited to failed items while the reproduced workflow still reports the expected statuses.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.