Running 2 iteration nodes in parallel causes iteration restart
Self Checks
- [x] This is only for bug report, if you would like to ask a question, please head to Discussions.
- [x] I have searched for existing issues search for existing issues, including closed ones.
- [x] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
- [x] Please do not modify this template :) and fill in all the required fields.
Dify version
0.15.3
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Create a workflow with 2 iteration nodes that run in parallel mode and merge in the same node video: https://drive.google.com/file/d/1XT93SqL-TsoknINr0X4Qya1QyHxU2ljT/view?usp=sharing
✔️ Expected Behavior
When the first iteration node is complete, it should wait for the second iteration node, without restarting it
❌ Actual Behavior
The iterations count restarts in the parallel iteration that was still running when the first one completed
There is a similar unsolved discussion regarding the issue of not having a choice of parallel in iteration, which might be related to your problem. You can find it here [1].
The issue you're experiencing with the iteration count restarting when running two iteration nodes in parallel in Dify version 0.15.3 is likely due to the way parallel execution is managed in the _run method of the IterationNode class. When one node completes before the other, the queue may receive a RunCompletedEvent or IterationRunFailedEvent, which causes the loop to break and potentially cancel remaining futures, leading to a restart of the iteration count [2].
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other
0.15.2 happen these fault as well: when the first parallel task completes, the second unfinished task restarts and resent. how to fix it? the second unfinished task restarts err code: [Errno 9] File descriptor was closed in another greenlet
很奇怪,从云服务版本并行访问两个api每看到未执行完的api重启,到那时docke compose部署的0.15.2和上面老哥一样会出现并行api未执行完会重新restart
有什么解决办法了吗?
0.15.2 api-1 | 2025-03-27 17:33:54,446.446 WARNING [Thread-47818 (_generate_worker)] [ssrf_proxy.py:67] - Request to URL https://openai.cn/v1/chat/completions failed on attempt 1: [Errno 9] File descriptor was closed in another greenlet api-1 | 2025-03-27 17:33:54,447.447 WARNING [Thread-47818 (_generate_worker)] [node.py:103] - http request node 17429728498230 failed to run: [Errno 9] File descriptor was closed in another greenlet
Hi there! Dify is rapidly evolving, and at the moment, we don't have the resources to maintain multiple versions. Version 0.15 will only receive security patches. I recommend upgrading to the latest version to see if the issue still persists.
I will retry this bug in the latest version and adjust the tagged version if necessary. Parallel execution, the milestone before plugins, suffers for other issues as it can be seen in my most recent reports.
Hi, @DavideDelbianco. I'm Dosu, and I'm helping the Dify team manage their backlog. I'm marking this issue as stale.
Issue Summary:
- A bug in Dify version 0.15.3 causes iteration counts to restart when running two iteration nodes in parallel.
- Similar issues, including file descriptor errors, were noted in version 0.15.2 by other users.
- Suggestions were made that the issue might be related to the
IterationNodeclass's management of parallel execution. - It was advised to upgrade to the latest version as older versions only receive security patches.
- You planned to test the bug in the latest version and update the issue.
Next Steps:
- Please confirm if this issue is still relevant to the latest version of Dify. If so, you can keep the discussion open by commenting here.
- If there is no further activity, this issue will be automatically closed in 15 days.
Thank you for your understanding and contribution!