Skip to content

[BUG] Forked tasks are CANCELED immediately #408

@avorima

Description

@avorima

Describe the bug

Defining a workflow with a fork task as described in the documentation immediately cancels the tasks after succeeding the FORK_JOIN.

Details
Conductor version: v3.21.12
Persistence implementation: Postgres/Elasticsearch
Queue implementation: Postgres/Redis
Lock: Postgres/Redis
Workflow definition:

repro.json
{
  "name": "simple_fork",
  "ownerEmail": "example@example.com",
  "description": "Simple workflow with fork task to reproduce bug",
  "version": 1,
  "schemaVersion": 2,
  "restartable": true,
  "workflowStatusListenerEnabled": true,
  "tasks": [
    {
      "name": "fork_task",
      "taskReferenceName": "fork_task",
      "type": "FORK_JOIN",
      "forkTasks": [
        [
          {
            "name": "task_a",
            "taskReferenceName": "task_a",
            "type": "SIMPLE"
          }
        ],
        [
          {
            "name": "task_b",
            "taskReferenceName": "task_b",
            "type": "SIMPLE"
          }
        ]
      ]
    },
    {
      "name": "join_task",
      "taskReferenceName": "join_task",
      "type": "JOIN",
      "joinOn": [
        "task1",
        "task2"
      ]
    }
  ]
}

Task definition:

tasks.json
[
    {
        "name": "fork_task",
        "ownerEmail": "example@example.com"
    },
    {
        "name": "join_task",
        "ownerEmail": "example@example.com"
    },
    {
        "name": "task_a",
        "timeoutPolicy": "RETRY",
        "retryLogic": "EXPONENTIAL_BACKOFF",
        "ownerEmail": "example@example.com"
    },
    {
        "name": "task_b",
        "timeoutPolicy": "RETRY",
        "retryLogic": "EXPONENTIAL_BACKOFF",
        "ownerEmail": "example@example.com"
    }
]

Event handler definition:

To Reproduce
Steps to reproduce the behavior:

  1. Follow the docker instructions to spin up a conductor instance with either default (redis+elasticsearch) or postgres confguration.
  2. Add tasks and workflow definitions
curl -XPOST http://localhost:8080/api/metadata/taskdefs -X @tasks.json
curl -XPOST http://localhost:8080/api/metadata/workflow -X @repro.json
  1. Got the conductor UI workbench tab and start a new simple_fork workflow.
  2. See error

Expected behavior

Tasks defined in forkTasks are scheduled correctly.

Screenshots

Image

Additional context

Looking further into it, it looks like the retryLogic and timeoutPolicy are at fault. If I create the tasks without them, the reproducer works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions