#2819·reqwest

What errors should be retried?

Author: konstinCreated Sep 18, 2025Updated Sep 4, 2026

In uv, both our users and us in our GitHub Actions CI frequently get errors during HTTP requests, for both streaming and non-streaming cases, that we need to retry. We started with the reqwest-retry library from reqwest-middleware, but over time we grew our own logic of cases that were reported, that now handles a lot of specific cases, but we're still finding more: https://github.com/astral-sh/uv/blob/0aa3c4e094052f072de395125ff8612cb9152762/crates/uv-client/src/base_client.rs#L985-L1069

@seanmonstar Are there any rules or heuristics you would suggest for error matching for comprehensive retrying? We want to avoid failing CI runs even when they have bad networking, but we also want to avoid creating multiple times the server load or being slow to error for something that cannot succeed.

Some examples of retry conditions we had to add: