Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

[FEATURE]: Idempotent task execution within fork. #3861

Open
dimiturPavlovski opened this issue Nov 24, 2023 · 4 comments
Open

[FEATURE]: Idempotent task execution within fork. #3861

dimiturPavlovski opened this issue Nov 24, 2023 · 4 comments
Labels
type: feature New feature

Comments

@dimiturPavlovski
Copy link

dimiturPavlovski commented Nov 24, 2023

Describe the Feature Request

Looking to have the capability to ensure idempotent parallel execution of tasks within a fork. It should be an alternative to the default fail-fast approach where, if a task fails within a fork, the other tasks get cancelled. The cancelled state causes problems on our side as it is a not deterministic state and the cancellation logic creates race conditions where other tasks within the same fork might get executed or might not.
download

Describe Preferred Solution

Describe Alternatives

We have a customer facing feature, that allows customers to define tasks as being optional or not. So for achieving idempotent execution of tasks within a fork we cannot leverage optional as it is reserved. Some tasks in the fork may be optional, or may not be optional. If not optional, we would like those to not interrupt the other tasks prior the join. Upon join, if any non-optional failed, we need to fail the join.

@dimiturPavlovski dimiturPavlovski added the type: feature New feature label Nov 24, 2023
ivakoleva added a commit to ivakoleva/conductor that referenced this issue Nov 27, 2023
Why:
We need idempotent forked tasks, meaning all tasks get
executed, but any failures are still detected upon join.
Feature request Netflix#3861

What:
Introduced the concept of Permissive tasks.
A Permissive task is similar to a Simple task. The
difference is, it permits the other tasks to continue -
in case a Permissive task failed.
Result is:
1. Forked Permissive tasks will let each other
be evaluated, until all the forked tasks had terminated.
Only then, the join task should fail. In case of Permissive
optional tasks, the join will not fail.
2. Permissive sequential tasks will let subsequent tasks
continue. While at the end, the workflow will fail in case
a permissive task had failed. The workflow would not fail
in case of Permissive optional task failure.

Testing done: PermissiveTaskMapperTest added,
TestDeciderOutcomes.testPermissive() added,
WorkflowAndTaskConfigurationSpec
"Test simple workflow which has a permissive task" and
"Test simple workflow which has a permissive optional task added"
that cover retry, ForkJoinSpec
"Test a simple workflow with fork join permissive failure flow"
added.
In addition, performed e2e tests locally running a Conductor instance.
Did build a docker image with the code changes made, started it locally,
and started a SampleWorker to poll 3 tasks in parallel.
Verified e2e scenarios of task_def_permissive, task_def_permissive_optional,
task_def_simple.json, task_def_simple_optional.json, each joining on
6 forked tasks, then running simple task 7 after join.
@wildMythicWest
Copy link
Contributor

+1

1 similar comment
@manish-panwar
Copy link

+1

@Robban1980
Copy link
Contributor

@dimiturPavlovski in the case above, in the case of the JOIN is set as failed because one task failed. Should the retry of the fork execute all of the tasks or only the one that failed?

@dimiturPavlovski
Copy link
Author

In the current version of conductor when a task in a fork fails, only failed and cancelled tasks get retried. Which will make sense in the future request too. https://github.com/Netflix/conductor/blob/main/test-harness/src/test/groovy/com/netflix/conductor/test/integration/ForkJoinSpec.groovy#L254

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: feature New feature
Projects
None yet
Development

No branches or pull requests

4 participants