question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exclusive Join not working when embedded in Fork/Join

See original GitHub issue

Exclusive Join not working when embedded in Fork/Join

Problem

Hello,

In one of our workflows we have a very specific with the following (generic) flow: Note: the task types assigned to any TASK step(s) are not bound to any specific task type, this can be either a JOIN/FORK, LAMBDA, SIMPLE, etc… task type.

FORK(T1) -> |
             TASK*(T2)                                          -> |
             DECISION(T2) -> TASK*(T3|T4) -> EXCLUSIVE JOIN(T5) -> |
                                                                    JOIN(T6)

When we embed a decision with an exclusive join inside another fork/join, the workflow will not continue processing after the exclusive join and with that never completing the parent join. This only happens when we have the parent join (T6), join on the exclusive join (T5) (which is valid, see “Working alternative”).

image

Failing decision metadata representation:

{
  "name" : "exclusive_join_test",
  "description" : "Exclusive Join Test",
  "version" : 1,
  "tasks" : [
    {
      "taskReferenceName" : "fork",
      "name" : "fork",
      "forkTasks" : [
        [
          {
            "name" : "lambda_nothing",
            "taskReferenceName" : "lambda_nothing",
            "inputParameters" : {
              "scriptExpression" : "return {value: \"nothing\"}"
            },
            "type" : "LAMBDA",
            "optional" : false,
            "asyncComplete" : false
          }
        ],
        [
          {
            "name" : "decision_test",
            "taskReferenceName" : "decision_test",
            "inputParameters" : {
              "case_value_param" : "${workflow.input.decision}"
            },
            "type" : "DECISION",
            "caseValueParam" : "case_value_param",
            "decisionCases" : {
              "true" : [
                {
                  "taskReferenceName" : "lambda_true",
                  "name" : "lambda_true",
                  "inputParameters" : {
                    "value" : "${workflow.input.decision}",
                    "scriptExpression" : "return {value: $.value}"
                  },
                  "optional" : false,
                  "type" : "LAMBDA",
                  "asyncComplete" : false
                }
              ]
            },
            "defaultCase" : [
              {
                "name" : "lambda_false",
                "taskReferenceName" : "lambda_false",
                "inputParameters" : {
                  "value" : "${workflow.input.decision}",
                  "scriptExpression" : "return {value: $.value}"
                },
                "type" : "LAMBDA",
                "optional" : false,
                "asyncComplete" : false
              }
            ],
            "optional" : false,
            "asyncComplete" : false
          },
          {
            "name" : "exclusive_join",
            "taskReferenceName" : "exclusive_join",
            "type" : "EXCLUSIVE_JOIN",
            "joinOn" : [
              "lambda_true",
              "lambda_false"
            ],
            "optional" : false,
            "defaultExclusiveJoinTask" : [
              "decision_test"
            ],
            "asyncComplete" : false
          }
        ]
      ],
      "type" : "FORK_JOIN"
    },
    {
      "name" : "join",
      "taskReferenceName" : "join",
      "joinOn" : [
        "lambda_nothing",
        "exclusive_join"
      ],
      "type" : "JOIN"
    }
  ],
  "inputParameters" : [
    "decision"
  ],
  "schemaVersion" : 2,
  "restartable" : true,
  "workflowStatusListenerEnabled" : false
}

Working alternative

However, when we isolate the same exclusive join outside of the fork/join, the exclusive join completes and the workflow continues as expected:

image

Working decision metadata representation:

{
  "name" : "exclusive_join_test",
  "description" : "Exclusive Join Test",
  "version" : 1,
  "tasks" : [
    {
      "name" : "decision_test",
      "taskReferenceName" : "decision_test",
      "inputParameters" : {
        "case_value_param" : "${workflow.input.decision}"
      },
      "type" : "DECISION",
      "caseValueParam" : "case_value_param",
      "decisionCases" : {
        "true" : [
          {
            "taskReferenceName" : "lambda_true",
            "name" : "lambda_true",
            "inputParameters" : {
              "value" : "${workflow.input.decision}",
              "scriptExpression" : "return {value: $.value}"
            },
            "optional" : false,
            "type" : "LAMBDA",
            "asyncComplete" : false
          }
        ]
      },
      "defaultCase" : [
        {
          "name" : "lambda_false",
          "taskReferenceName" : "lambda_false",
          "inputParameters" : {
            "value" : "${workflow.input.decision}",
            "scriptExpression" : "return {value: $.value}"
          },
          "type" : "LAMBDA",
          "optional" : false,
          "asyncComplete" : false
        }
      ],
      "optional" : false,
      "asyncComplete" : false
    },
    {
      "name" : "exclusive_join",
      "taskReferenceName" : "exclusive_join",
      "type" : "EXCLUSIVE_JOIN",
      "joinOn" : [
        "lambda_true",
        "lambda_false"
      ],
      "optional" : false,
      "defaultExclusiveJoinTask" : [
        "decision_test"
      ],
      "asyncComplete" : false
    }
  ],
  "inputParameters" : [
    "decision"
  ],
  "schemaVersion" : 2,
  "restartable" : true,
  "workflowStatusListenerEnabled" : false
}

Some metadata:

Conductor version: 2.10.2

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
apanicker-nflxcommented, Aug 20, 2019

Thanks for reporting the issue. We will look into fixing this issue soon. However, feel free to submit a PR with the fix if you need this sooner.

1reaction
apanicker-nflxcommented, Dec 24, 2019

Fixed as part of #1449

Read more comments on GitHub >

github_iconTop Results From Across the Web

Observable forkJoin not firing - Stack Overflow
A very common problem with forkJoin is that it requires all source Observables to emit at least one item and ...
Read more >
Combining Observables with forkJoin in RxJS
In this post you'll learn how to use the forkJoin operator in RxJS. forkJoin is one of the most popular combination operators due...
Read more >
RxJS: Error Handling With forkJoin | by João Victor Ghignatti
When we combine multiple observables, trying to handle errors becomes a real problem, RxJS methods mostly don't behave as you'd want.
Read more >
fork within loop with join ALL | Verification Academy
There reason you can't just use fork/join is because of the outer for_loop used to spawn each sequence (process) with a fork statement....
Read more >
Guide to the Fork/Join Framework in Java - Baeldung
Simply put, free threads try to “steal” work from deques of busy threads. By default, a worker thread gets tasks from the head...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found