conductor-oss / conductor-oss/conductor

[BUG] Forked tasks are CANCELED immediately

Open
#408 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
32.2k
Forks
1k
Avg merge
2d 3h
Merged PRs (30d)
37

Description

**Describe the bug**

Defining a workflow with a fork task as described in the [documentation](https://conductor-oss.github.io/conductor/documentation/configuration/workflowdef/operators/fork-task.html) 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](https://github.com/conductor-oss/conductor/tree/main/docker) 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
```
4. Got the conductor UI workbench tab and start a new `simple_fork` workflow.
5. See error

**Expected behavior**

Tasks defined in forkTasks are scheduled correctly.

**Screenshots**

![Image](https://github.com/user-attachments/assets/1e8c30b0-a7dd-4a7f-973f-40f563528188)

**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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.