Skip to content

Fix timeout propagation after redirects - #3692

Merged
1 commit merged into
tornadoweb:masterfrom
Sanjays2402:fix/redirect-timeout-propagation
Nov 13, 2026
Merged

1 commit merged into
tornadoweb:masterfrom
Sanjays2402:fix/redirect-timeout-propagation

Conversation

@Sanjays2402

Copy link
Copy Markdown
Contributor

SimpleAsyncHTTPClient followed redirects through the public Future API, so a timeout on the redirected request was raised from a done callback and the original fetch never completed. Continue through fetch_impl's response callback so the 599 error reaches the caller while retaining request defaults.

Adds a local redirect-to-stalled-handler regression test. Fixes #3064.

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
@bdarnell

Copy link
Copy Markdown
Member

I fixed #3064 in #3878 without realizing that we had an open PR for it here, and I like your solution better than claude's, so I'm going to merge this commit. There's a merge conflict, so it will be merged in PR #3887. Thanks!

bdarnell pushed a commit that referenced this pull request Nov 13, 2026
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
@bdarnell bdarnell closed this pull request by merging all changes into tornadoweb:master in ae48b7b Nov 13, 2026
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.

simple_httpclient: Timeout after redirect not raised properly

2 participants