asyncComplete is specified to true,however simple task is executed multiple times。 #3570
Replies: 1 comment 1 reply
-
Hi @zhouwanbin, In the provided code, you are using a Set taskIdSet to store the task IDs that have already been executed. You are checking whether the task ID is in the set before executing the task again, which helps to prevent the task from being executed multiple times. However, this approach might not be sufficient to handle certain edge cases, especially in a distributed environment. To stop a simple task from being executed multiple times in a more reliable manner, consider the following suggestions:
{
|
Beta Was this translation helpful? Give feedback.
-
Example workflow:
{
"name": "json-worker-flow",
"description": "json-worker-flow",
"version": 0,
"tasks": [
{
"name": "taskC",
"taskReferenceName": "dt_taskD_0_ref",
"description": "dt_taskD_0",
"inputParameters": {
"city": "${workflow.input.city}"
},
"startDelay": 0,
"asyncComplete": true,
"retryCount": 0,
"workflowTaskType": "SIMPLE"
}
],
"timeoutPolicy": "TIME_OUT_WF",
"timeoutSeconds": 3600,
"ownerEmail": "[email protected]"
}
Example task:
public class AsyncWorkerC implements Worker {
}
Beta Was this translation helpful? Give feedback.
All reactions