Refactor uv retrayble strategy to use a single code path#17099
Merged
Conversation
zanieb
reviewed
Dec 12, 2025
crates/uv-client/src/base_client.rs
Outdated
| /// * When streaming a response, a reqwest error may be hidden several layers behind errors | ||
| /// of different crates processing the stream, including `io::Error` layers. | ||
| pub fn is_transient_network_error(err: &(dyn Error + 'static)) -> bool { | ||
| fn uv_retryable_strategy(err: &(dyn Error + 'static)) -> Option<Retryable> { |
Member
There was a problem hiding this comment.
Is this documentation for this function up-to-date still?
zanieb
reviewed
Dec 12, 2025
crates/uv-client/src/base_client.rs
Outdated
| let retryable = match res { | ||
| Ok(success) => default_on_request_success(success), | ||
| // The uv retryable strategy contains `default_on_request_failure` | ||
| Err(err) => uv_retryable_strategy(err), |
Member
There was a problem hiding this comment.
Can we rename this to retryable_on_request_failure for consistency with the reqwest_retry naming?
zanieb
reviewed
Dec 12, 2025
crates/uv-client/src/base_client.rs
Outdated
| default => default, | ||
| let retryable = match res { | ||
| Ok(success) => default_on_request_success(success), | ||
| // The uv retryable strategy contains `default_on_request_failure` |
Member
There was a problem hiding this comment.
This this comment just be on the uv_retryable_strategy doc comment? I think it makes more sense there?
b76ab5b to
1e18331
Compare
Refactoring that allows uv's retryable strategy to return Some(Retryable::Fatal), which is also helpful for #16245. We need to change the way we're reporting retries to avoid both the retry middleware and our own retry context to report the retry numbers.
1e18331 to
7571ffa
Compare
EliteTK
approved these changes
Dec 16, 2025
Contributor
EliteTK
left a comment
There was a problem hiding this comment.
Looked at this in the context of the other changes and in the context of what I've learned about this code yesterday/today. Looks good from my end.
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.
Refactoring that allows uv's retryable strategy to return
Some(Retryable::Fatal), also helpful for #16245