orquesta icon indicating copy to clipboard operation
orquesta copied to clipboard

Fail Fast control for with item task

Open exp-vkishore opened this issue 4 years ago • 2 comments

Currently the incomplete items in a task's with list won't be processed if there are no active task item and parent task has failed status. For example let's consider this workflow

version: 1.0

description: A workflow demonstrating with items and concurrent processing.

input:
  - members  # [0,1,2,3]
  - concurrency: 1

tasks:
  task1:
    with:
      items: <% ctx(members) %>
      concurrency: <% ctx(concurrency) %>
    action: core.local cmd="[ item() -eq  1 ] && exit 1 || exit 0"

If we run above workflow it will process items 0 and 1 only, as on member 1 action will fail which will set the task1 status as fail and the concurrency is set to 1 there for there will be no active task item and state of task1 will be set to failed from running. And no other item will be processed.

With this change I have introduce a boolean parameter failfast in task which will decide wether to fail the entire task if there are not active task item and task status is failed.

version: 1.0

description: A workflow demonstrating with items and concurrent processing.

input:
  - members  # [0,1,2,3]
  - concurrency: 1

tasks:
  task1:
    failfast: false
    with:
      items: <% ctx(members) %>
      concurrency: <% ctx(concurrency) %>
    action: core.local cmd="[ item() -eq  1 ] && exit 1 || exit 0"

exp-vkishore avatar Dec 03 '21 11:12 exp-vkishore

@exp-vkishore would you be able to revisit this? What do you think of @m4dcoder 's suggestion of a flow: keyword under with:?

cognifloyd avatar Apr 02 '22 05:04 cognifloyd

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar May 11 '22 11:05 CLAassistant