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

Workflow Processor - DAG Execution Ordering #2599

Open
jem-davies opened this issue May 18, 2024 · 3 comments
Open

Workflow Processor - DAG Execution Ordering #2599

jem-davies opened this issue May 18, 2024 · 3 comments
Labels
enhancement processors Any tasks or issues relating specifically to processors

Comments

@jem-davies
Copy link

jem-davies commented May 18, 2024

Issue Description

The Benthos provided processor Workflow executes a DAG of Nodes, "performing them in parallel where possible".

However the current implementation uses this dependency solver and it takes the approach: resolve the DAG into series of steps where the steps are performed sequentially but the nodes in the step are performed in parallel.

This means that there can be a situation where a step could be waiting for all the nodes in the previous step: even though all dependencies for the step are ready.

Consider the following DAG, from the workflow processor docs:

      /--> B -------------|--> D
     /                   /
A --|          /--> E --|
     \--> C --|          \
               \----------|--> F

The dependency solver would resolve the DAG into: [ [ A ], [ B, C ], [ E ], [ D, F ] ].
When we consider the node E, we can see the that full dependency of this node would be : A -> C -> E, however in the stage before [ E ], there is the node B so in the current Benthos Workflow implementation E would not execute until B even though there is no dependency of B for E.

@jem-davies
Copy link
Author

jem-davies commented May 18, 2024

Added Draft MR #2600 to resolve / gather feedback.

@mihaitodor mihaitodor added enhancement processors Any tasks or issues relating specifically to processors labels May 23, 2024
@jem-davies
Copy link
Author

jem-davies commented May 25, 2024

Closed Draft MR #2600 as the commit messages didn't contain a signed-off-by line.

Opened new Draft MR #2607 for feedback.

@jem-davies
Copy link
Author

The MR is a draft MR because I am making breaking changes to the way workflow is configured so rather than:

pipeline:
  processors:
    - workflow:
        order: [ [ A ], [ B] ]

        branches:
          A:
            processors:
              #...

          B:
            processors:
              #...
pipeline:
  processors:
    - workflow_v2:

        branches:
          A:
            processors:
              #...

          B:
            dependency_list: ["A"]
            processors:
              #...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement processors Any tasks or issues relating specifically to processors
Projects
None yet
Development

No branches or pull requests

2 participants