Repository navigation
fix(v2ex): retry urllib timeouts with bounded curl fallback - #902
Merged
Panniantong merged 1 commit intoNov 8, 2026
Merged
Panniantong merged 1 commit into
Panniantong merged 1 commit into
Conversation
Owner
|
Thanks! Merged. Verified on macOS: |
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.
Fixes #900
V2EX requests that time out in Python's TLS stack currently fail without trying the native curl fallback. This extends the existing exception-chain check to recognize
TimeoutError, including a timeout wrapped inURLError. On the supported Python versions,socket.timeoutis the same exception type.The fallback still runs once with its existing HTTPS-only URL validation, certificate verification, response size limit, and independent 10-second curl budget. urllib keeps its existing 10-second timeout; the action's outer deadline is unchanged. HTTP errors, certificate verification failures, malformed responses, and error strings that merely mention a timeout do not qualify.
Regression tests exercise the public action dispatcher with the real HTTP boundary mocked: direct/wrapped timeouts recover a topic through curl, while five non-retryable failures never start curl.
Validation on macOS / Python 3.12, without a GPU:
ruff check agent_reach testsandmypy agent_reach: passed.git diff --check: passed.Actual
agent-reach check v2ex --textoutput:The reporter's Windows TLS-handshake condition is reproduced with injected HTTP-boundary exceptions in regression tests; live acceptance above is on macOS. Other OS/Python combinations remain for CI.