The response status code of the large model is abnormal, indicating that the request concurrency is too high, causing the retry function to fail. #8167

Closed
opened 2026-02-21 18:24:18 -05:00 by yindo · 3 comments
Owner

Originally created by @xiewentu on GitHub (Feb 11, 2025).

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

The self-built large model has a limitation that it can only concurrently process three requests per second. In Dify, the workflow is configured to retry failed requests after 2 seconds. However, the retry function is not operating as intended, failing to execute retries, which results in the workflow not running properly. This issue leads to disruptions in the workflow operations due to unsuccessful request handling.
Image

2. Additional context or comments

In the workflow, there are multiple tasks that require parallel calls to LLMs, and each large model may randomly encounter request failures, necessitating retries.

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @xiewentu on GitHub (Feb 11, 2025). ### Self Checks - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### 1. Is this request related to a challenge you're experiencing? Tell me about your story. The self-built large model has a limitation that it can only concurrently process three requests per second. In Dify, the workflow is configured to retry failed requests after 2 seconds. However, the retry function is not operating as intended, failing to execute retries, which results in the workflow not running properly. This issue leads to disruptions in the workflow operations due to unsuccessful request handling. ![Image](https://github.com/user-attachments/assets/fee1bce5-4349-4d34-8d15-18a95e322e5c) ### 2. Additional context or comments In the workflow, there are multiple tasks that require parallel calls to LLMs, and each large model may randomly encounter request failures, necessitating retries. ### 3. Can you help us with this feature? - [ ] I am interested in contributing to this feature.
yindo added the 🌊 feat:workflow label 2026-02-21 18:24:18 -05:00
yindo closed this issue 2026-02-21 18:24:18 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 11, 2025):

There are similar discussions and an issue related to handling retries and status code 429 in Dify:

  1. I'm encountering an error message 'Reached maximum retries (3) for URL ...' when using the HTTP request component in Dify. - This discussion is unsolved and might provide insights into similar retry issues [1].

  2. The large model does not have access to the uploaded image, and then it appears: Reached maximum retries - Another unsolved discussion that deals with retry issues [2].

  3. Handling 429 error from Azure OpenAI - This discussion addresses handling 429 errors, which might be relevant to your situation [3].

To address the issue of the retry function failing due to high request concurrency, consider the following adjustments:

  • Ensure that the max_retries is set to a reasonable number to allow sufficient retry attempts.
  • Adjust the BACKOFF_FACTOR to increase the wait time between retries, which can help reduce the load on the server and avoid hitting the rate limit.
  • Implement a more sophisticated backoff strategy that considers the Retry-After header if provided by the server in response to a 429 status code.
  • Monitor and adjust the max_active_requests setting in the RateLimit class to ensure it aligns with your application's concurrency needs [4][5].

Additionally, you can enable the "Retry on Failure" feature in the HTTP request node, which automatically retries requests based on a preset strategy. Configure the maximum number of retries and the interval between retries to better handle transient errors like 429 [6].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other | Bug Report

@dosubot[bot] commented on GitHub (Feb 11, 2025): <!-- Answer --> There are similar discussions and an issue related to handling retries and status code 429 in Dify: 1. [I'm encountering an error message 'Reached maximum retries (3) for URL ...' when using the HTTP request component in Dify.](https://github.com/langgenius/dify/discussions/10322) - This discussion is unsolved and might provide insights into similar retry issues <sup>[[1]](https://github.com/langgenius/dify/discussions/10322)</sup>. 2. [The large model does not have access to the uploaded image, and then it appears: Reached maximum retries](https://github.com/langgenius/dify/discussions/10100) - Another unsolved discussion that deals with retry issues <sup>[[2]](https://github.com/langgenius/dify/discussions/10100)</sup>. 3. [Handling 429 error from Azure OpenAI](https://github.com/langgenius/dify/discussions/3493) - This discussion addresses handling 429 errors, which might be relevant to your situation <sup>[[3]](https://github.com/langgenius/dify/discussions/3493)</sup>. To address the issue of the retry function failing due to high request concurrency, consider the following adjustments: - Ensure that the `max_retries` is set to a reasonable number to allow sufficient retry attempts. - Adjust the `BACKOFF_FACTOR` to increase the wait time between retries, which can help reduce the load on the server and avoid hitting the rate limit. - Implement a more sophisticated backoff strategy that considers the `Retry-After` header if provided by the server in response to a 429 status code. - Monitor and adjust the `max_active_requests` setting in the `RateLimit` class to ensure it aligns with your application's concurrency needs <sup>[[4]](https://github.com/langgenius/dify/blob/main/api/core/helper/ssrf_proxy.py)</sup><sup>[[5]](https://github.com/langgenius/dify/blob/main/api/core/app/features/rate_limiting/rate_limit.py)</sup>. Additionally, you can enable the "Retry on Failure" feature in the HTTP request node, which automatically retries requests based on a preset strategy. Configure the maximum number of retries and the interval between retries to better handle transient errors like 429 <sup>[[6]](https://github.com/langgenius/dify-docs/blob/main/en/guides/workflow/node/http-request.md)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/0ef15395-3c96-4986-a651-43bd6ae4a027?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/0ef15395-3c96-4986-a651-43bd6ae4a027?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/0ef15395-3c96-4986-a651-43bd6ae4a027?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/0ef15395-3c96-4986-a651-43bd6ae4a027?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/0ef15395-3c96-4986-a651-43bd6ae4a027?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/0ef15395-3c96-4986-a651-43bd6ae4a027?feedback_type=other) | [Bug Report](https://app.dosu.dev/response-feedback/0ef15395-3c96-4986-a651-43bd6ae4a027?feedback_type=bug_report)</sup>
Author
Owner

@crazywoola commented on GitHub (Feb 11, 2025):

For bug report please use bug report template, I am not quite understand what you are trying to achieve here.

@crazywoola commented on GitHub (Feb 11, 2025): For bug report please use bug report template, I am not quite understand what you are trying to achieve here.
Author
Owner

@xiewentu commented on GitHub (Feb 13, 2025):

Understood, I will create an issue in the form of a bug for this content.

For bug report please use bug report template, I am not quite understand what you are trying to achieve here.

@xiewentu commented on GitHub (Feb 13, 2025): Understood, I will create an issue in the form of a bug for this content. > For bug report please use bug report template, I am not quite understand what you are trying to achieve here.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#8167