Giter VIP home page Giter VIP logo

Comments (11)

jsha avatar jsha commented on June 8, 2024 11

FYI I've run a smoke test across the Tranco list and the Majestic Million with RUSTFLAGS="-Zsanitizer=address -C debug-assertions -C overflow-checks --target x86_64-unknown-linux-gnu", and had no panics or crashes on the latest release.

from ureq.

Shnatsel avatar Shnatsel commented on June 8, 2024 1

I've tried setting really high timeouts for both connection and read (5_000_000) but the issue persists.

from ureq.

lolgesten avatar lolgesten commented on June 8, 2024

5_000_000 is a high timeout indeed. #32 might do something to address this, but it seems strange an infinite timeout would be any better than 5_000_000.

from ureq.

jsha avatar jsha commented on June 8, 2024

I've tried and failed to reproduce this. As of right now, on my Ubuntu 20.04 system, 7911game.com produces connection timeouts with both ureq and curl:

$ time cargo run http://7911game.com
    Finished dev [unoptimized + debuginfo] target(s) in 0.04s
     Running `target/debug/curl3 'http://7911game.com'`
Error: Oops("Connection Failed: Connection timed out (os error 110)")

real    2m10.222s
user    0m0.036s
sys     0m0.018s
$ time curl http://7911game.com -i -vvv
*   Trying 39.96.202.49:80...
* TCP_NODELAY set
* connect to 39.96.202.49 port 80 failed: Connection timed out
* Failed to connect to 7911game.com port 80: Connection timed out
* Closing connection 0
curl: (28) Failed to connect to 7911game.com port 80: Connection timed out

real    2m11.390s
user    0m0.000s
sys     0m0.016s

I've also adapted one of the unittests from #67 to dribble out data every 10ms for 300 seconds, and found that ureq successfully fetches the whole thing.

@Shnatsel, does this still reproduce for you? Do you have a more self-contained test case?

from ureq.

Shnatsel avatar Shnatsel commented on June 8, 2024

I suppose that website has fixed their weird behavior, whatever it was.

I've discovered this issue by downloading frontpages of the top million websites with a bunch of different HTTP clients and comparing the results. A more thorough writeup can be found here.

I suppose that's the easiest way to discover cases when it happens, and it might also uncover other issues.

from ureq.

jsha avatar jsha commented on June 8, 2024

Good plan, I've been meaning to put together a tool to do that. I didn't see a link to your code in that blog post - if you still have it around, you could save me a bit of time.

from ureq.

Shnatsel avatar Shnatsel commented on June 8, 2024

https://gist.github.com/deltaphc/2949ed292c7d1169e744e5ffa7fd0687

invocation looked like this: cut -d , -f 3 majestic_million.csv | parallel -j 50 ./fetch-one-url.sh

where “fetch-one-url.sh” sets RUST_BACKTRACE=1, calls the Rust binary wrapped in timeout and sorts the outputs into folders depending on exit code. I don't have the contents of that script anymore.

I’ve also tried setting -C debug-assertions -C overflow-checks rustc flags when compiling, but fortunately that didn’t reveal anything interesting back then. It's probably a good idea to set them nevertheless.

from ureq.

Shnatsel avatar Shnatsel commented on June 8, 2024

Oh and I've compiled with Address Sanitizer of course. Nightly Rust, -Zsanitizer=address

from ureq.

jsha avatar jsha commented on June 8, 2024

Thanks for the tips on compile flags. I've set up a test harness and am running a similar test over the Tranco list. Once I've gotten through a run of that, I'll do the Majestic Million as well. It's already yielded useful fruit like #84.

For the specific test code you shared:

    let res = ureq::get(&url)
        .timeout_connect(5_000)
        .call();

    if res.error() {
        println!("{:?}", res);
    }
    println!("\n\nDone.");

This doesn't call res.into_read(), so it's not reading the body. That would produce the behavior you describe - the program would exit, successfully, as soon as it received headers, rather than waiting to read the whole (slow) body.

from ureq.

jsha avatar jsha commented on June 8, 2024

By the way, I've added the smoke test code I used at #85 if you'd like to try it out.

from ureq.

Shnatsel avatar Shnatsel commented on June 8, 2024

Ah, that's probably a bug in my code then, and not in ureq itself. Closing.

from ureq.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.