-
Notifications
You must be signed in to change notification settings - Fork 119
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Bug description
The reqwest-retry middleware retries a connect error which is not transient. This is happens on a "misconfiguration" of the features reqwest crate when building, though leads me to wonder that perhaps not all errors stemming from is_connect are indeed transient.
reqwest-middleware/reqwest-retry/src/retryable_strategy.rs
Lines 139 to 144 in 1692cad
| #[cfg(not(target_arch = "wasm32"))] | |
| let is_connect = error.is_connect(); | |
| #[cfg(target_arch = "wasm32")] | |
| let is_connect = false; | |
| if error.is_timeout() || is_connect { | |
| Some(Retryable::Transient) |
To Reproduce
[package]
name = "reqwest-connect-error"
version = "0.1.0"
edition = "2024"
[dependencies]
reqwest = { version = "0.13.1", default-features = false }
tokio = { version = "1.49.0", features = ["full"] }#[tokio::main]
async fn main() {
let client = reqwest::Client::new();
let e = client.get("https://github.com").send().await.unwrap_err();
eprintln!("{e:?}");
eprintln!("is_connect: {}", e.is_connect());
}Expected behavior
Expected the middleware to stop on the first try.
Environment
- OS: Linux
- Rust version: 1.92.0
Additional context
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working