Repository navigation
fix(error): detect timeouts wrapped in body decode errors - #3064
Merged
seanmonstar merged 1 commit intoJul 13, 2026
Merged
Conversation
Owner
|
Thanks for the PR! I kind of feel like it should still wrap the error in "decode", because the error happened while decoding the body. An alternative would be to just make |
Contributor
Author
|
Thanks for the feedback, let me see how i can improve this! |
raphaelroshan
marked this pull request as ready for review
July 6, 2026 07:04
When a read/total timeout fired while streaming the response body, the error is wrapped as a decode error (Kind::Decode), so is_timeout() did not report it even though a timeout was the underlying cause. Make is_timeout() also recurse into a nested reqwest::Error while walking the source chain, so a timeout wrapped in a decode error is still detected. The error keeps its decode kind (it did happen while decoding the body). Closes seanmonstar#2839
raphaelroshan
force-pushed
the
fix-2839-body-timeout-error
branch
from
July 8, 2026 13:42
10e301a to
5446168
Compare
Contributor
Author
|
@seanmonstar I've updated it based on your feedback, its now a small change touching is_timeout(). Updated the tests as well |
kodiakhq Bot
pushed a commit
to pdylanross/fatigue
that referenced
this pull request
Sep 14, 2026
Bumps reqwest from 0.13.4 to 0.13.5. Release notes Sourced from reqwest's releases. v0.13.5 tl;dr Add Error::is_dns() to identify errors caused by DNS resolution failures. Add ClientBuilder::http1_max_headers(usize) to configure the maximum number of headers accepted in an HTTP/1 response (default 100). Add TLS version to TlsInfo extension. Fix hickory-dns feature to use Ipv6AndIpv4 strategy to prefer IPv6. Fix sending wrong proxy-auth if multiple proxies intercept a given URL. What's Changed fix(blocking): preserve version and extensions in TryFromhttp::Request by @wwhsaber in seanmonstar/reqwest#3050 Remove unnecessary clones by @FranciscoTGouveia in seanmonstar/reqwest#3052 Add Referrer and Referrer Policy methods to WASM Request API by @Billy-Sheppard in seanmonstar/reqwest#3049 chore(deps): bump actions/checkout from 6 to 7 by @dependabot[bot] in seanmonstar/reqwest#3058 feat: add Error::is_dns() to identify DNS resolution failures by @JoakoI98 in seanmonstar/reqwest#3057 Fix blocking client timeout panic by @V-Mann-Nick in seanmonstar/reqwest#3060 Use LookupIpStrategy::Ipv6AndIpv4 to actually prefer IPv6 when using hickory-dns by @FalkWoldmann in seanmonstar/reqwest#3063 feat: Add ClientBuilder::http1_max_headers by @smaeda-ks in seanmonstar/reqwest#3065 feat: expose the negotiated TLS version via TlsInfo by @dennisameling in seanmonstar/reqwest#3067 fix(error): detect timeouts wrapped in body decode errors by @raphaelroshan in seanmonstar/reqwest#3064 Remove unnecessary clones and a cast by @FranciscoTGouveia in seanmonstar/reqwest#3071 chore(deps): upgrade base64 to 0.23 by @paolobarbolini in seanmonstar/reqwest#3074 perf(body): reuse tokio::time::Sleep timer via reset() in ReadTimeoutBody by @spellsaif in seanmonstar/reqwest#3085 fix(cookie): avoid cloning store and url on Poll::Pending in ResponseFuture::poll by @spellsaif in seanmonstar/reqwest#3084 src/async_impl/request.rs_improved_doc_for_json_fn: by @Athleteg in seanmonstar/reqwest#3082 fix: proxy could use wrong credentials if many matched by @seanmonstar in seanmonstar/reqwest#3098 New Contributors @wwhsaber made their first contribution in seanmonstar/reqwest#3050 @FranciscoTGouveia made their first contribution in seanmonstar/reqwest#3052 @Billy-Sheppard made their first contribution in seanmonstar/reqwest#3049 @JoakoI98 made their first contribution in seanmonstar/reqwest#3057 @V-Mann-Nick made their first contribution in seanmonstar/reqwest#3060 @FalkWoldmann made their first contribution in seanmonstar/reqwest#3063 @smaeda-ks made their first contribution in seanmonstar/reqwest#3065 @raphaelroshan made their first contribution in seanmonstar/reqwest#3064 @spellsaif made their first contribution in seanmonstar/reqwest#3085 @Athleteg made their first contribution in seanmonstar/reqwest#3082 Full Changelog: seanmonstar/reqwest@v0.13.4...v0.13.5 Changelog Sourced from reqwest's changelog. v0.13.5 Add Error::is_dns() to identify errors caused by DNS resolution failures. Add ClientBuilder::http1_max_headers(usize) to configure the maximum number of headers accepted in an HTTP/1 response (default 100). Add TLS version to TlsInfo extension. Fix hickory-dns feature to use Ipv6AndIpv4 strategy to prefer IPv6. Fix sending wrong proxy-auth if multiple proxies intercept a given URL. Commits de55373 v0.13.5 4d3fe12 fix: proxy could use wrong credentials if many matched (#3098) 9f06fd2 docs: improve description of JSON method (#3082) 5bdb2f0 perf(cookie): avoid cloning store and url on Poll::Pending in ResponseFuture:... ffda263 perf(body): reuse tokio::time::Sleep timer via reset() in ReadTimeoutBody (#3... 4e9a3c7 chore: add pull request template for human-written content 17e9bcb chore(deps): upgrade base64 to 0.23 (#3074) 221abe9 chore: Remove unnecessary clones and a cast (#3071) 99996a1 fix(error): detect timeouts wrapped in body decode errors (#3064) fc99bd5 feat: expose the negotiated TLS version via TlsInfo (#3067) Additional commits viewable in compare view Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase. Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: @dependabot rebase will rebase this PR @dependabot recreate will recreate this PR, overwriting any edits that have been made to it @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2839.
When a read or total timeout fires while streaming the response body, the error is wrapped as a decode error (
Kind::Decode), sois_timeout()didn't report it even though a timeout was the underlying cause — andis_decode()was true with the message "error decoding response body", which is misleading.Per review feedback, this keeps the decode kind (the error did happen while decoding the body) and instead makes
is_timeout()recurse into a nestedreqwest::Errorwhile walking the source chain. So a timeout wrapped in a decode error is now correctly reported byis_timeout(), whileis_decode()stays true.Added unit tests covering a body timeout wrapped by
decode(bothis_decode()andis_timeout()are true) and that an unrelated decode error is not a timeout.