Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connect_timeout not firing an error #2166

Open
tmpfs opened this issue Mar 10, 2024 · 1 comment
Open

connect_timeout not firing an error #2166

tmpfs opened this issue Mar 10, 2024 · 1 comment

Comments

@tmpfs
Copy link
Contributor

tmpfs commented Mar 10, 2024

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 reqwest@v0.11.25.

@seanmonstar
Copy link
Owner

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants