feat: add a http_retries setting to define number of retry attempts#6444
feat: add a http_retries setting to define number of retry attempts#6444
Conversation
|
I think just on install and maybe use would be good for now. I think global might be weird with Maybe we could make this a setting too? Or maybe instead of the CLI flag? |
|
Agreed. Having just a setting (and env var) is probably better than a flag and aligns better with the |
|
Might be good to name it |
|
It's currently implemented on HTTP level so it also affects other commands/requests like fetching GitHub releases/tags which is part of a tool installation. So it also applies when getting latest version via |
|
Ahh I see. Hmm. I was thinking this would be at a higher level for tool installs but maybe http is better? |
There was a problem hiding this comment.
Pull Request Overview
This PR adds HTTP retry functionality to mise with a configurable http_retries setting. The implementation uses an exponential backoff strategy with jitter to automatically retry failed HTTP requests.
- Adds a new
http_retriesconfiguration setting with default value of 0 (no retries) - Implements retry logic for both file downloads and general HTTP requests using the tokio-retry crate
- Uses exponential backoff with jitter starting from 10ms base duration
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/http.rs | Implements retry logic for HTTP operations using tokio-retry with exponential backoff |
| settings.toml | Adds http_retries configuration setting with documentation |
| schema/mise.json | Updates JSON schema to include the new http_retries setting |
| Cargo.toml | Adds tokio-retry dependency |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
bugbot run |
### 📦 Registry - re-enable tests by @risu729 in [#6454](#6454) - restore comments and tests by @risu729 in [#6378](#6378) - add github backend for graphite by @jdx in [#6455](#6455) ### 🚀 Features - **(backend)** add environment variable override for tool backends by @jdx in [#6456](#6456) - add a http_retries setting to define number of retry attempts by @roele in [#6444](#6444) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Bump version to 2025.9.22 with updated completions cache keys, registry tweak for CycloneDX assets, doc star count update, and usage-cli tool bump. > > - **Release/versioning** > - Bump `mise` to `2025.9.22` in `Cargo.toml`, `Cargo.lock`, `default.nix`, `packaging/rpm/mise.spec`, and update version in `README.md`. > - Add `CHANGELOG.md` entry for `2025.9.22`. > - **Completions** > - Update cached usage spec keys in `completions/_mise`, `completions/mise.bash`, and `completions/mise.fish` to `2025_9_22`. > - **Registry** > - Adjust CycloneDX `cyclonedx-cli` assets in `crates/.../cyclonedx-cli/registry.yaml` (remove linux musl overrides in version overrides). > - **Tooling/lockfile** > - Bump `cargo:usage-cli` to `2.3.0` in `mise.lock`. > - **Docs** > - Update stars count in `docs/.vitepress/stars.data.ts` to `19.6k`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 5b3be09. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: mise-en-dev <release@mise.jdx.dev> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
I gave
Add --retry option for mise install(#6429) a try (hence draft).Not quite sure about making this global even though it affects various commands (e.g. ls, install, outdated, ...). Also not sure about the wording. Should we use
MISE_HTTP_RETRIESto make it more clear or leave it open for possible use for other types of retries?WDYT @jdx?
Note
Adds a new
http_retriessetting and implements exponential-backoff retries for HTTP requests and downloads.tokio-retrywith exponential backoff + jitter insrc/http.rs(download_file_with_headers,send_with_https_fallback).default_backoff_strategy(retries)helper to control retry count.settings.http_retries(env:MISE_HTTP_RETRIES) with docs; exposed insettings.tomlandschema/mise.json.tokio-retrycrate; updateCargo.tomlandCargo.lock.Written by Cursor Bugbot for commit ac6c653. This will update automatically on new commits. Configure here.