Fix retry layering and NO_PROXY wildcard after the Gem::Request switch - #9799
Merged
Conversation
Gem::Request already resends requests on stale connections and Bundler::Retry retries failed requests, so the Gem::Net::HTTP retry layer (max_retries defaults to 1) only multiplied the number of attempts, doubling the worst-case wait on a host that times out. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
net-http-persistent treated NO_PROXY="*" as a request to bypass the proxy for every host, but Gem::URI::Generic.use_proxy? parses "*" as a literal hostname that never matches, so the wildcard stopped disabling proxies after the switch to Gem::Request. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The switch from net-http-persistent to Gem::Request (#9786) aligned Bundler proxy handling with RubyGems: https_proxy now takes precedence for https sources, proxy credential variables follow the scheme, :http_proxy: :no_proxy in .gemrc now also disables environment proxies, and NO_PROXY matching is strict about dot boundaries. None of this was documented anywhere, so describe the current semantics in the bundle-config man page. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
#9786 replaced Bundler's vendored net-http-persistent with
Gem::Request, which introduced two regressions. TheGem::Net::HTTPretry layer (max_retriesdefaults to 1) stacked on top of the retries inGem::Request#perform_requestandBundler::Retry, doubling the worst-case wait on a host that times out, so Bundler connections now setmax_retries = 0.NO_PROXY="*", which net-http-persistent honored as a bypass-everything wildcard, is parsed byGem::URI::Generic.use_proxy?as a literal hostname and stopped disabling proxies, soproxy_forrestores it.The switch also changed proxy semantics deliberately.
https_proxynow takes precedence for https sources, proxy credential variables follow the scheme,:http_proxy: :no_proxyin.gemrcalso disables environment proxies, andNO_PROXYmatching is strict about dot boundaries. These match RubyGems and curl, so they are kept and documented in a new PROXY SUPPORT section of thebundle-configman page.