Skip to content

simple_httpclient: Clean up redirect error handling - #3887

Merged
bdarnell merged 3 commits into
tornadoweb:masterfrom
bdarnell:claude/redirect-errors-3692
Nov 13, 2026
Merged

bdarnell merged 3 commits into
tornadoweb:masterfrom
bdarnell:claude/redirect-errors-3692

Conversation

@bdarnell

Copy link
Copy Markdown
Member

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.

Sanjays2402 and others added 3 commits July 13, 2026 13:58
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
@bdarnell
bdarnell merged commit ae48b7b into tornadoweb:master Nov 13, 2026
20 checks passed
@bdarnell
bdarnell deleted the claude/redirect-errors-3692 branch November 13, 2026 20:06
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

Successfully merging this pull request may close these issues.

3 participants