reqwest icon indicating copy to clipboard operation
reqwest copied to clipboard

connect_timeout not firing an error

Open tmpfs opened this issue 1 year ago • 1 comments

I have set connect_timeout() and would expect the future to Err once the timeout expires but I am seeing my program hang indefinitely.

I can reproduce it with any unreachable IP on my LAN:

use std::time::Duration;

#[tokio::main]
async fn main() {
    let client = reqwest::ClientBuilder::new()
        .connect_timeout(Duration::from_millis(1000))
        .build().unwrap();
    // Unreachable IP address
    client.get("http://192.168.1.8:5053").send().await.unwrap();
}

Am I missing something or do you think this is a bug?

Using [email protected].

tmpfs avatar Mar 10 '24 20:03 tmpfs

Could be a bug, could be something more happening on your system. Hard to know, since the option does work for many people. Are you able to dig into what may be different?

seanmonstar avatar Mar 11 '24 12:03 seanmonstar