[PR #12788] Introduce Configurable Upper-Limits/default values for max retries and retry Interval in Error Handling(#12787) #27748

Closed
opened 2026-02-21 20:42:07 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/12788

State: closed
Merged: No


Summary

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Close #12787

Screenshots

Before change

Default retry config in dify cloud version

LLM

  • default is disable
  • if enabled, default max_retry=3, retry_interval=1000ms
  • important note: left side is default i.e. status immediately after node is created. right side is status immediately after enabled.

image

  • upper limit is max_retry=10, retry_interval=5000ms

image

HTTP

  • default is enabled
  • if enabled, default max_retry=3, retry_interval=100ms
  • This image is the one immediately after HTTP node is created.

image

  • upper limit is max_retry=10, retry_interval=5000ms

image

Tool node

  • default is disable
  • if enabled, default max_retry=3, retry_interval=1000ms
  • important note: left side is default i.e. status immediately after node is created. right side is status immediately after enabled.

image

  • upper limit is max_retry=10, retry_interval=5000ms

image

After change

to test if behavior with commited code is the same as that before the change

LLM

  • default is disable
  • if enabled, default max_retry=3, retry_interval=1000ms
  • important note: left side is default i.e. status immediately after node is created. right side is status immediately after enabled.

screenshots

  • upper limit is max_retry=10, retry_interval=5000ms

image

HTTP

  • default is enabled, default max_retry=3, retry_interval=100ms
  • This image is the one immediately after HTTP node is created.
  • upper limit is max_retry=10, retry_interval=5000ms

left is to to check default, right is to to check upper limit
image

Tool node

  • default is disable
  • if enabled, default max_retry=3, retry_interval=1000ms
  • important note: left side is default i.e. status immediately after node is created. right side is status immediately after enabled.

image

  • upper limit is max_retry=10, retry_interval=5000ms

image

to test if config file works as expected

LLM

  • retry is disabled, default max_retry=2, retry_interval=200ms as default
  • upper limit: max_retry=8, retry_interval=2000
// Retries related parameters of LLM Node
export const MAX_RETRIES_DEFAULT_LLM_NODE = 2
export const RETRY_INTERVAL_DEFAULT_LLM_NODE = 200
export const RETRY_ENABLED_DEFAULT_LLM_NODE = false
export const MAX_RETRIES_UPPER_BOUND_LLM_NODE = 10
export const RETRY_INTERVAL_UPPER_BOUND_LLM_NODE = 2000

image
image

HTTP

  • retry is disabled, default max_retry=1, retry_interval=900ms as default
  • upper limit: max_retry=4, retry_interval=9000
// Retries related parameters of HTTP Node
export const MAX_RETRIES_DEFAULT_HTTP_NODE = 1
export const RETRY_INTERVAL_DEFAULT_HTTP_NODE = 900
export const RETRY_ENABLED_DEFAULT_HTTP_NODE = false
export const MAX_RETRIES_UPPER_BOUND_HTTP_NODE = 4
export const RETRY_INTERVAL_UPPER_BOUND_HTTP_NODE = 9000

image
image

Tool

  • retry is disabled, default max_retry=6, retry_interval=600ms as default
  • upper limit: max_retry=7, retry_interval=6666
// Retries related parameters of Tool Node
export const MAX_RETRIES_DEFAULT_TOOL_NODE = 6
export const RETRY_INTERVAL_DEFAULT_TOOL_NODE = 600
export const RETRY_ENABLED_DEFAULT_TOOL_NODE = false
export const MAX_RETRIES_UPPER_BOUND_TOOL_NODE = 7
export const RETRY_INTERVAL_UPPER_BOUND_TOOL_NODE = 6666

image
image

Checklist

Important

Please review the checklist below before submitting your pull request.

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods
**Original Pull Request:** https://github.com/langgenius/dify/pull/12788 **State:** closed **Merged:** No --- # Summary Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. Close #12787 # Screenshots ## Before change Default retry config in dify cloud version **LLM** - default is disable - if enabled, default max_retry=3, retry_interval=1000ms - important note: left side is default i.e. status immediately after node is created. right side is status immediately after enabled. ![image](https://github.com/user-attachments/assets/c097c6f3-91d3-45cf-bd68-8201d9e98d6b) - upper limit is max_retry=10, retry_interval=5000ms ![image](https://github.com/user-attachments/assets/336ae715-80ae-43fc-a175-ed534a5f65cc) **HTTP** - default is enabled - if enabled, default max_retry=3, retry_interval=100ms - This image is the one immediately after HTTP node is created. ![image](https://github.com/user-attachments/assets/d5577833-7a24-40ff-9b1d-66ea94575c90) - upper limit is max_retry=10, retry_interval=5000ms ![image](https://github.com/user-attachments/assets/07f7b1c2-cd9a-4618-8209-bda8b3e75eb0) **Tool node** - default is disable - if enabled, default max_retry=3, retry_interval=1000ms - important note: left side is default i.e. status immediately after node is created. right side is status immediately after enabled. ![image](https://github.com/user-attachments/assets/e18efc49-bbd7-4487-ada1-09dc8677539f) - upper limit is max_retry=10, retry_interval=5000ms ![image](https://github.com/user-attachments/assets/485c5320-4650-45a6-a4df-4548aaea5a35) ## After change ### to test if behavior with commited code is the same as that before the change **LLM** - default is disable - if enabled, default max_retry=3, retry_interval=1000ms - important note: left side is default i.e. status immediately after node is created. right side is status immediately after enabled. ![screenshots](https://github.com/user-attachments/assets/e635b9aa-7a10-4b2f-9765-632ce7837442) - upper limit is max_retry=10, retry_interval=5000ms ![image](https://github.com/user-attachments/assets/1578d22b-e69a-4c8e-887c-8e8a02add41b) **HTTP** - default is enabled, default max_retry=3, retry_interval=100ms - This image is the one immediately after HTTP node is created. - upper limit is max_retry=10, retry_interval=5000ms left is to to check default, right is to to check upper limit ![image](https://github.com/user-attachments/assets/e060d151-ebfc-4eee-a4de-5c2ecdbf67f5) **Tool node** - default is disable - if enabled, default max_retry=3, retry_interval=1000ms - important note: left side is default i.e. status immediately after node is created. right side is status immediately after enabled. ![image](https://github.com/user-attachments/assets/9dc3ce2a-4965-4b55-a72b-4a63676adef9) - upper limit is max_retry=10, retry_interval=5000ms ![image](https://github.com/user-attachments/assets/1dedd12a-5a74-4e09-8aa3-3aa3dacd268f) ### to test if config file works as expected **LLM** - retry is disabled, default max_retry=2, retry_interval=200ms as default - upper limit: max_retry=8, retry_interval=2000 ```python // Retries related parameters of LLM Node export const MAX_RETRIES_DEFAULT_LLM_NODE = 2 export const RETRY_INTERVAL_DEFAULT_LLM_NODE = 200 export const RETRY_ENABLED_DEFAULT_LLM_NODE = false export const MAX_RETRIES_UPPER_BOUND_LLM_NODE = 10 export const RETRY_INTERVAL_UPPER_BOUND_LLM_NODE = 2000 ``` ![image](https://github.com/user-attachments/assets/eac4290f-c4b1-45ea-8867-64b87e27ec1c) ![image](https://github.com/user-attachments/assets/87e09830-0390-4edb-9a99-8cbadfcbefeb) **HTTP** - retry is disabled, default max_retry=1, retry_interval=900ms as default - upper limit: max_retry=4, retry_interval=9000 ```python // Retries related parameters of HTTP Node export const MAX_RETRIES_DEFAULT_HTTP_NODE = 1 export const RETRY_INTERVAL_DEFAULT_HTTP_NODE = 900 export const RETRY_ENABLED_DEFAULT_HTTP_NODE = false export const MAX_RETRIES_UPPER_BOUND_HTTP_NODE = 4 export const RETRY_INTERVAL_UPPER_BOUND_HTTP_NODE = 9000 ``` ![image](https://github.com/user-attachments/assets/eda1730d-144c-4f76-9e36-8e63a108b3f1) ![image](https://github.com/user-attachments/assets/06b46d1c-d1ce-4218-b95e-cc15bd445333) **Tool** - retry is disabled, default max_retry=6, retry_interval=600ms as default - upper limit: max_retry=7, retry_interval=6666 ```python // Retries related parameters of Tool Node export const MAX_RETRIES_DEFAULT_TOOL_NODE = 6 export const RETRY_INTERVAL_DEFAULT_TOOL_NODE = 600 export const RETRY_ENABLED_DEFAULT_TOOL_NODE = false export const MAX_RETRIES_UPPER_BOUND_TOOL_NODE = 7 export const RETRY_INTERVAL_UPPER_BOUND_TOOL_NODE = 6666 ``` ![image](https://github.com/user-attachments/assets/fde64525-e75f-4d05-a0f1-285770bd1e4a) ![image](https://github.com/user-attachments/assets/e2d7ab9d-fbcb-4e7e-922c-d95caade6174) # Checklist > [!IMPORTANT] > Please review the checklist below before submitting your pull request. - [ ] This change requires a documentation update, included: [Dify Document](https://github.com/langgenius/dify-docs) - [x] I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!) - [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change. - [x] I've updated the documentation accordingly. - [x] I ran `dev/reformat`(backend) and `cd web && npx lint-staged`(frontend) to appease the lint gods
yindo added the pull-request label 2026-02-21 20:42:07 -05:00
yindo closed this issue 2026-02-21 20:42:08 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#27748