Skip to content

feat(config): add configurable max_retries for backend requests#1817

Merged
gaius-qi merged 1 commit intomainfrom
feature/retry
Apr 28, 2026
Merged

feat(config): add configurable max_retries for backend requests#1817
gaius-qi merged 1 commit intomainfrom
feature/retry

Conversation

@gaius-qi
Copy link
Copy Markdown
Member

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 Backend struct, with a sensible default, and is wired through the client creation logic.

Configuration and API changes:

  • Added a max_retries field to the Backend struct in dragonfly-client-config/src/dfdaemon.rs, including serde support and a default value of 1. [1] [2] [3]
  • Updated the HTTP backend constructor and struct in dragonfly-client-backend/src/http.rs to accept and store the max_retries parameter, and use it when building retry policies. [1] [2] [3] [4] [5]
  • Updated BackendFactory in dragonfly-client-backend/src/lib.rs to pass the configured max_retries value when constructing HTTP/HTTPS backends. [1] [2]

Code cleanup:

  • Removed the now-unused constant MAX_RETRY_TIMES from dragonfly-client-backend/src/lib.rs.
  • Removed the MAX_RETRY_TIMES import from dragonfly-client-backend/src/http.rs.

Dependency and versioning:

  • Bumped all crate versions from 1.3.7 to 1.3.8 in Cargo.toml to reflect the new feature. [1] [2]

Related Issue

Motivation and Context

Screenshots (if appropriate)

@gaius-qi gaius-qi added this to the v2.5.0 milestone Apr 28, 2026
@gaius-qi gaius-qi self-assigned this Apr 28, 2026
@gaius-qi gaius-qi requested review from a team as code owners April 28, 2026 12:57
@gaius-qi gaius-qi added the enhancement New feature or request label Apr 28, 2026
@gaius-qi gaius-qi enabled auto-merge (squash) April 28, 2026 12:58
Signed-off-by: Gaius <gaius.qi@gmail.com>
@gaius-qi gaius-qi disabled auto-merge April 28, 2026 13:17
@gaius-qi gaius-qi merged commit 6058282 into main Apr 28, 2026
7 checks passed
@gaius-qi gaius-qi deleted the feature/retry branch April 28, 2026 13:17
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.56%. Comparing base (1f448d5) to head (99f7e29).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            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              
Files with missing lines Coverage Δ
dragonfly-client-backend/src/http.rs 96.09% <100.00%> (+0.02%) ⬆️
dragonfly-client-backend/src/lib.rs 96.33% <100.00%> (+0.02%) ⬆️
dragonfly-client-config/src/dfdaemon.rs 89.35% <100.00%> (+0.04%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants