apache / apache/dolphinscheduler
[Bug] When contains multiple sub-processes, the task instance in the sub-process instance obtains duplicate parameters of the pre-task instance.
- Dominant language
- Java
- Stars
- 14.5k
- Forks
- 5.1k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 28
Description
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
在工作流中,创建多个子流程,例如创建12个子流程,子流程在获取上游任务参数时,会出现覆盖/错误/以及12个节点拿到的参数完全一致,这不符合预期
通过数据库中查询来看,生成的12的子流程实例,参数没有问题,但是在varpool的设置阶段,获取parent_process_instance_id所对应的varpool,是相同的,这导致子流程实例中的任务实例,执行时的参数永远是相同的
### What you expected to happen
通过数据库中查询来看,生成的12的子流程实例,参数没有问题,但是在varpool的设置阶段,获取parent_process_instance_id所对应的varpool,是相同的,这导致子流程实例中的任务实例,执行时的参数永远是相同的
通过debug setSubProcessParam这个方法,能够看出每个子流程任务实例获取到的varpool参数都有问题,并且会随机出现重复
### How to reproduce
我已经验证了3.2.1的standalone镜像,3.2.2的standalone镜像,debug镜像代码,都存在此问题,也可以在这两个镜像web服务页面,复现。我提供了我的验证工作流json,⚠️注意:导入后需要更改主流程中子流程的引用为新的id
[workflow_1733366901095.json](https://github.com/user-attachments/files/18016619/workflow_1733366901095.json)
### Anything else
_No response_
### Version
3.2.x
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
Contributor guide
Research direction
Start by reproducing the workflow from workflow_1733366901095.json on the 3.2.1 or 3.2.2 standalone image, then trace setSubProcessParam and the lookup of parent_process_instance_id in the varpool. Done means each sub-process instance receives its own upstream parameters rather than duplicated or randomly repeated values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100