Repository navigation
Retry a request whose proxy cannot be reached - #4
Open
levidurfee wants to merge 1 commit into
Open
levidurfee wants to merge 1 commit into
levidurfee wants to merge 1 commit into
Conversation
net/http reports a failed dial to a proxy as a "proxyconnect" *net.OpError wrapping the dial error, and errors.As stopped at the outer one, so the request was treated as possibly sent. Calls that are retried only when the request certainly was not sent, such as CreateKey, then failed after one attempt, against the package documentation's promise that a failure to connect is always retried. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NYjhaGqZtskW52B5CMxFQS
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.
Defect
net/http reports a failed dial to a proxy as a
*net.OpErrorwithOp: "proxyconnect"wrapping the dial error.retryableErrusederrors.As, which stops at the outerOpError, and comparedOpwith"dial"only. A request whose HTTPS proxy could not be reached was therefore treated as possibly sent.Consequence
Calls retried only when the request certainly was not sent (
CreateKey,CreateAPIToken,RotateKey,CreateContainer, and the otherretryIfUnprocessedcalls) failed after one attempt when the proxy was unreachable. The package documentation states that every request is retried after a failure to connect. The default client honoursHTTPS_PROXY, so the path is reachable withoutWithHTTPClient.Change
retryableErrtreatsOp == "proxyconnect"as a failure to connect. net/http applies that wrapper only to errors raised while setting up the connection to the proxy, before the request is written.TestProxyDialErrorRetriedpoints a transport at a closed proxy port and expectsDefaultMaxAttemptsattempts. The test fails ondevelopmentwithafter 1 attemptand passes with the change.Checks
make check,go test -race, and staticcheck 2026.2.2 with-tags integrationpass locally.Generated by Claude Code