Skip to content

Fix retry layering and NO_PROXY wildcard after the Gem::Request switch - #9799

Merged
hsbt merged 3 commits into
masterfrom
fetcher-proxy-retry-fixes
Aug 24, 2026
Merged

Fix retry layering and NO_PROXY wildcard after the Gem::Request switch#9799
hsbt merged 3 commits into
masterfrom
fetcher-proxy-retry-fixes

Conversation

@hsbt

@hsbt hsbt commented Aug 24, 2026

Copy link
Copy Markdown
Member

#9786 replaced Bundler's vendored net-http-persistent with Gem::Request, which introduced two regressions. The Gem::Net::HTTP retry layer (max_retries defaults to 1) stacked on top of the retries in Gem::Request#perform_request and Bundler::Retry, doubling the worst-case wait on a host that times out, so Bundler connections now set max_retries = 0. NO_PROXY="*", which net-http-persistent honored as a bypass-everything wildcard, is parsed by Gem::URI::Generic.use_proxy? as a literal hostname and stopped disabling proxies, so proxy_for restores it.

The switch also changed proxy semantics deliberately. https_proxy now takes precedence for https sources, proxy credential variables follow the scheme, :http_proxy: :no_proxy in .gemrc also disables environment proxies, and NO_PROXY matching is strict about dot boundaries. These match RubyGems and curl, so they are kept and documented in a new PROXY SUPPORT section of the bundle-config man page.

hsbt and others added 3 commits August 23, 2026 18:04
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>
@hsbt
hsbt merged commit 7e16037 into master Aug 24, 2026
167 of 172 checks passed
@hsbt
hsbt deleted the fetcher-proxy-retry-fixes branch August 24, 2026 03:03
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.

1 participant