Repository navigation
simple_httpclient: Clean up redirect error handling - #3887
Merged
bdarnell merged 3 commits intoNov 13, 2026
Merged
Conversation
A timeout from a redirected request was raised from its done callback, leaving the original fetch unresolved. Continue redirects through the callback interface so error responses reach the original fetch, and cover the timeout path with a regression test. Fixes tornadoweb#3064
Conflict in simple_httpclient.py: master fixed the same hang in ee9b0d4 by catching the exception from the redirected fetch's future. Keep this branch's approach of passing the original callback to fetch_impl, which delivers every error response without the extra future. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VamvWqdwiBTCFwhDLCbBee
The redirect hang fixed in tornadoweb#3064 also happened when the redirected request failed to connect. Cover that case in the common tests, so that both clients are checked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VamvWqdwiBTCFwhDLCbBee
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.
I fixed a problem with error handling in redirects in #3878 without realizing that we had an open issue #3064 for it, and @Sanjays2402 had a cleaner solution in #3692. This PR merges the commit from #3692 and adds an additional test.