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

task with join: all starts without waiting for all the previous task completed when there is a loop #263

Open
LIHANG-HONG opened this issue Dec 10, 2023 · 0 comments

Comments

@LIHANG-HONG
Copy link

LIHANG-HONG commented Dec 10, 2023

I made a workflow having 3 parallel tasks each of which randomly fails, along with a task join all of them.
If all of the parallel tasks success, then the workflow will end. Otherwise, the workflow steps back to rerun the parallel tasks. The yaml code is as followed:

version: 1.0

description: loop parallel workflow.

input:
  - x: {}
  - y: {}
  - z: {}

output:
  - data:
      x: <% ctx().x %>
      y: <% ctx().y %>
      z: <% ctx().z %>

tasks:
  entrypoint:
    next: 
      - do: parallel

  parallel:
    action: core.noop
    next:
      - do: random_failure1,random_failure2, random_failure3

  random_failure1:
    action: my_pack.random_failure
    next:
      - publish: x=<% result() %>
        do: count_failure

  random_failure2:
    action: my_pack.random_failure
    next:
      - publish: y=<% result() %>
        do: count_failure

  random_failure3:
    action: my_pack.random_failure
    next:
      - publish: z=<% result() %>
        do: count_failure

  count_failure:
    join: all
    action: my_pack.count_failure
    input:
      - x=<% ctx(x) %>
      - y=<% ctx(y) %>
      - z=<% ctx(z) %> 
    next:
      - when: <% result().failure_count > 0 %>
        do: tasks

In the first trial, the count_failure task starts after all of the 3 parallel task end and gets the context x, y, z updated by parallel tasks. Let s call the context x1, y1, z1.
However, in the second loop, the count_failure task starts after any of the 3 parallel task end. Assuming that random_failure1 ends first and count_failure will start immediately after that, with the context to be x2(updated by random_failure1), y1(not updated), z1(not updated). And when random_failure2 ends, another count_failure task starts with input like x2, y2, z1.

I am expecting the count_failure task also starts starts after all of the 3 parallel task end in the second loop, with input updated as x2, y2, z2.
Is this a bug, or the constraint of the graph based workflow in orquesta?

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

No branches or pull requests

1 participant