feat(config): add configurable max_retries for backend requests#1817
Merged
feat(config): add configurable max_retries for backend requests#1817
Conversation
Signed-off-by: Gaius <gaius.qi@gmail.com>
imeoer
approved these changes
Apr 28, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1817 +/- ##
==========================================
+ Coverage 43.53% 43.56% +0.02%
==========================================
Files 92 92
Lines 26917 26929 +12
==========================================
+ Hits 11719 11731 +12
Misses 15198 15198
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request introduces a configurable maximum retry count for backend HTTP requests, replacing the previous hardcoded value. The change allows users to specify how many times a failed backend request should be retried before giving up, improving flexibility and error handling. The new configuration is exposed in the
Backendstruct, with a sensible default, and is wired through the client creation logic.Configuration and API changes:
max_retriesfield to theBackendstruct indragonfly-client-config/src/dfdaemon.rs, including serde support and a default value of 1. [1] [2] [3]HTTPbackend constructor and struct indragonfly-client-backend/src/http.rsto accept and store themax_retriesparameter, and use it when building retry policies. [1] [2] [3] [4] [5]BackendFactoryindragonfly-client-backend/src/lib.rsto pass the configuredmax_retriesvalue when constructing HTTP/HTTPS backends. [1] [2]Code cleanup:
MAX_RETRY_TIMESfromdragonfly-client-backend/src/lib.rs.MAX_RETRY_TIMESimport fromdragonfly-client-backend/src/http.rs.Dependency and versioning:
1.3.7to1.3.8inCargo.tomlto reflect the new feature. [1] [2]Related Issue
Motivation and Context
Screenshots (if appropriate)