dolphinscheduler icon indicating copy to clipboard operation
dolphinscheduler copied to clipboard

[Bug] [MasterServer] Submit duplicate tasks

Open mchcz opened this issue 4 years ago • 3 comments

Search before asking

  • [X] I had searched in the issues and found no similar issues.

What happened

1.Many SQL tasks submitted at the same time 2.It will be retried when a task fails, and may be submitted multiple times when retrying 3.The task instance code is the same for multiple submissions

[INFO] 2022-01-04 00:50:34.791 org.apache.dolphinscheduler.service.process.ProcessService:[1076] - end submit task to db successfully:6838135 013.XXX:SUBMITTED_SUCCESS complete, instance id:609369 state: RUNNING_EXECUTION [INFO] 2022-01-04 00:50:35.315 org.apache.dolphinscheduler.service.process.ProcessService:[1076] - end submit task to db successfully:6838145 013.XXX:SUBMITTED_SUCCESS complete, instance id:609369 state: RUNNING_EXECUTION

image

image

image

What you expected to happen

When the task is retried, submit it once.

How to reproduce

The reason is unknown.

Anything else

No response

Version

2.0.1

Are you willing to submit PR?

  • [ ] Yes I am willing to submit a PR!

Code of Conduct

mchcz avatar Jan 04 '22 08:01 mchcz

Hi:

  • Thank you for your feedback, we have received your issue, Please wait patiently for a reply.
  • In order for us to understand your request as soon as possible, please provide detailed information、version or pictures.
  • If you haven't received a reply for a long time, you can subscribe to the developer's email,Mail subscription steps reference https://dolphinscheduler.apache.org/en-us/community/development/subscribe.html ,Then write the issue URL in the email content and send question to [email protected].

github-actions[bot] avatar Jan 04 '22 08:01 github-actions[bot]

@mchcz can you provide the DAG info? I can't reproduce it at local.

caishunfeng avatar Jan 04 '22 09:01 caishunfeng

image image 454387769cb60b28eb72a754c53d6aa 698ec6741cfcebde7574d277fce2602

When task A fail and run WorkflowExecuteThread.taskFinished, it will add retry task into standby queue, which will submit by WorkflowExecuteThread.submitPostNode and StateWheelExecuteThread.checkTask4Retry; When I add sleep 30s in submitTaskInstanceToDB like Figure 4, it will increase the probability of repeated retries. In this way, retry task A in standby list will be submit by WorkflowExecuteThread.submitPostNode because run task c, and then, StateWheelExecuteThread.checkTask4Retry add it into standby list and submit again.

caishunfeng avatar Jan 06 '22 15:01 caishunfeng