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

Timeout causing panic #13

Closed
nscooling opened this issue Aug 23, 2019 · 12 comments · Fixed by #114
Closed

Timeout causing panic #13

nscooling opened this issue Aug 23, 2019 · 12 comments · Fixed by #114
Labels
bug Bugs and defects (faults of monolith, not target websites)

Comments

@nscooling
Copy link

With a slow/unreliable internet connection then keep getting this error:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error(Io(Custom { kind: TimedOut, error: "timed out" }), 
"https://www.kinesisbikes.co.uk/Catalogue/Models/Adventure/Tripster-AT")', src/libcore/result.rs:999:5
@snshn
Copy link
Member

snshn commented Aug 23, 2019

Thank you for the heads up, I'll try to increase the default timeout as well as handle this panic better.

@snshn
Copy link
Member

snshn commented Aug 23, 2019

Merged #15 in, should be better on slow connections now, but I think the only way to completely resolve this issue would be to handle failing download attempts in a safe manner (e.g. continue retrieving other assets if one fails).

@nscooling
Copy link
Author

Thanks, it handling some but still timing out of others

@snshn
Copy link
Member

snshn commented Aug 25, 2019

I improved the code to treat all network errors as blank responses, this should help saving pages with resources that timeout or throw other kinds of errors. Please let me know if it got rid of the panic. I'm thinking of adding a -t option for setting extended timeout in case of slow Internet connection.

@snshn snshn added the bug Bugs and defects (faults of monolith, not target websites) label Aug 25, 2019
@TerminusBot
Copy link

TerminusBot commented Jan 31, 2020

thread 'main' panicked at 'called Result::unwrap() on an Err value: reqwest::Error { kind: Decode, source: TimedOut }', src/libcore/result.rs:1165:5
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace.

maybe the best solution is retrying if panic happens

@snshn
Copy link
Member

snshn commented Jan 31, 2020

@TerminusBot it happens for the very first request, right?

@TerminusBot
Copy link

@snshn totally right

@snshn
Copy link
Member

snshn commented Jan 31, 2020

I'll look into it this weekend, thank you for the info

@TerminusBot
Copy link

I just set the timeout 60 and it works very well now.

@snshn
Copy link
Member

snshn commented Feb 3, 2020

@TerminusBot I've added a new flag (-t/--timeout) and bumped the timeout to be 30 seconds by default in #114. I believe that should resolve this problem once and for all. Please let me know if 30 seconds is enough.

@TerminusBot
Copy link

@TerminusBot I've added a new flag (-t/--timeout) and bumped the timeout to be 30 seconds by default in #114. I believe that should resolve this problem once and for all. Please let me know if 30 seconds is enough.

Sorry, 60 is good enough for me and it works well in production, so I may not test.But you have added the new parameter and we have an easy way to solve this bug.
You have a great job! Monolith helps me a lot. Thanks again!

@snshn
Copy link
Member

snshn commented Feb 11, 2020

@TerminusBot I bumped it to 120 seconds, that seems to be what Chrome and FF are doing regarding network request timeout. If you do -t 0 it'll be infinite. Please let me know if there's anything else that I could improve!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs and defects (faults of monolith, not target websites)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants