<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/lib/rubygems/remote_fetcher.rb, branch v4.0.2</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Merge RubyGems/Bundler 4.0.6</title>
<updated>2026-02-10T01:38:24+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2026-02-10T01:07:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e025c839ac71b609bb50ff74352f9a11cd164c3c'/>
<id>e025c839ac71b609bb50ff74352f9a11cd164c3c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/rubygems] Increase connection pool to allow for up to 70% speed increase:</title>
<updated>2025-12-04T06:47:46+00:00</updated>
<author>
<name>Edouard CHIN</name>
<email>chin.edouard@gmail.com</email>
</author>
<published>2025-11-16T23:18:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=932762f29457ad1def6fbab7eca7bcbeeb58ea5c'/>
<id>932762f29457ad1def6fbab7eca7bcbeeb58ea5c</id>
<content type='text'>
- ### TL;DR

  Bundler is heavily limited by the connection pool which manages a
  single connection. By increasing the number of connection, we can
  drastiscally speed up the installation process when many gems need
  to be downloaded and installed.

  ### Benchmark

  There are various factors that are hard to control such as
  compilation time and network speed but after dozens of tests I
  can consistently get aroud 70% speed increase when downloading and
  installing 472 gems, most having no native extensions (on purpose).

  ```
  # Before
  bundle install  28.60s user 12.70s system 179% cpu 23.014 total

  # After
  bundle install  30.09s user 15.90s system 281% cpu 16.317 total
  ```

  You can find on this gist how this was benchmarked and the Gemfile
  used https://gist.github.com/Edouard-chin/c8e39148c0cdf324dae827716fbe24a0

  ### Context

  A while ago in #869, Aaron introduced a connection pool which
  greatly improved Bundler speed. It was noted in the PR description
  that managing one connection was already good enough and it wasn't
  clear whether we needed more connections. Aaron also had the
  intuition that we may need to increase the pool for downloading
  gems and he was right.

  &gt; We need to study how RubyGems uses connections and make a decision
  &gt; based on request usage (e.g. only use one connection for many small
  &gt; requests like bundler API, and maybe many connections for
  &gt; downloading gems)

  When bundler downloads and installs gem in parallel https://github.com/ruby/rubygems/blob/4f85e02fdd89ee28852722dfed42a13c9f5c9193/bundler/lib/bundler/installer/parallel_installer.rb#L128
  most threads have to wait for the only connection in the pool to be
  available which is not efficient.

  ### Solution

  This commit modifies the pool size for the fetcher that Bundler
  uses. RubyGems fetcher will continue to use a single connection.

  The bundler fetcher is used in 2 places.

  1. When downloading gems https://github.com/ruby/rubygems/blob/4f85e02fdd89ee28852722dfed42a13c9f5c9193/bundler/lib/bundler/source/rubygems.rb#L481-L484
  2. When grabing the index (not the compact index) using the
    `bundle install --full-index` flag.
    https://github.com/ruby/rubygems/blob/4f85e02fdd89ee28852722dfed42a13c9f5c9193/bundler/lib/bundler/fetcher/index.rb#L9

  Having more connections in 2) is not any useful but tweaking the
  size based on where the fetcher is used is a bit tricky so I opted
  to modify it at the class level.
  I fiddle with the pool size and found that 5 seems to be the sweet
  spot at least for my environment.

https://github.com/ruby/rubygems/commit/6063fd9963
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- ### TL;DR

  Bundler is heavily limited by the connection pool which manages a
  single connection. By increasing the number of connection, we can
  drastiscally speed up the installation process when many gems need
  to be downloaded and installed.

  ### Benchmark

  There are various factors that are hard to control such as
  compilation time and network speed but after dozens of tests I
  can consistently get aroud 70% speed increase when downloading and
  installing 472 gems, most having no native extensions (on purpose).

  ```
  # Before
  bundle install  28.60s user 12.70s system 179% cpu 23.014 total

  # After
  bundle install  30.09s user 15.90s system 281% cpu 16.317 total
  ```

  You can find on this gist how this was benchmarked and the Gemfile
  used https://gist.github.com/Edouard-chin/c8e39148c0cdf324dae827716fbe24a0

  ### Context

  A while ago in #869, Aaron introduced a connection pool which
  greatly improved Bundler speed. It was noted in the PR description
  that managing one connection was already good enough and it wasn't
  clear whether we needed more connections. Aaron also had the
  intuition that we may need to increase the pool for downloading
  gems and he was right.

  &gt; We need to study how RubyGems uses connections and make a decision
  &gt; based on request usage (e.g. only use one connection for many small
  &gt; requests like bundler API, and maybe many connections for
  &gt; downloading gems)

  When bundler downloads and installs gem in parallel https://github.com/ruby/rubygems/blob/4f85e02fdd89ee28852722dfed42a13c9f5c9193/bundler/lib/bundler/installer/parallel_installer.rb#L128
  most threads have to wait for the only connection in the pool to be
  available which is not efficient.

  ### Solution

  This commit modifies the pool size for the fetcher that Bundler
  uses. RubyGems fetcher will continue to use a single connection.

  The bundler fetcher is used in 2 places.

  1. When downloading gems https://github.com/ruby/rubygems/blob/4f85e02fdd89ee28852722dfed42a13c9f5c9193/bundler/lib/bundler/source/rubygems.rb#L481-L484
  2. When grabing the index (not the compact index) using the
    `bundle install --full-index` flag.
    https://github.com/ruby/rubygems/blob/4f85e02fdd89ee28852722dfed42a13c9f5c9193/bundler/lib/bundler/fetcher/index.rb#L9

  Having more connections in 2) is not any useful but tweaking the
  size based on where the fetcher is used is a bit tricky so I opted
  to modify it at the class level.
  I fiddle with the pool size and found that 5 seems to be the sweet
  spot at least for my environment.

https://github.com/ruby/rubygems/commit/6063fd9963
</pre>
</div>
</content>
</entry>
<entry>
<title>[rubygems/rubygems] Restrict what schemes are acceptable in the remote fetcher</title>
<updated>2025-10-16T23:40:04+00:00</updated>
<author>
<name>Aaron Patterson</name>
<email>tenderlove@ruby-lang.org</email>
</author>
<published>2025-10-16T21:05:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4f51f6243eb75395dcc31407fd76cc1b2b356c65'/>
<id>4f51f6243eb75395dcc31407fd76cc1b2b356c65</id>
<content type='text'>
The remote fetcher only works with certain schemes (`http`, `https`,
`s3`, and `file`).  It's possible for other schemes to show up in this
code and it can cause bugs.

Before this patch, doing `gem install path:///hello` would result in an
infinite loop because this function would do `send "fetch_path"`,
calling itself forever.  Now we see an exception.

I think we should validate gem names earlier, but it's really best
practice to restrict the possible strings passed to `send`.

https://github.com/rubygems/rubygems/commit/54e2781b73
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The remote fetcher only works with certain schemes (`http`, `https`,
`s3`, and `file`).  It's possible for other schemes to show up in this
code and it can cause bugs.

Before this patch, doing `gem install path:///hello` would result in an
infinite loop because this function would do `send "fetch_path"`,
calling itself forever.  Now we see an exception.

I think we should validate gem names earlier, but it's really best
practice to restrict the possible strings passed to `send`.

https://github.com/rubygems/rubygems/commit/54e2781b73
</pre>
</div>
</content>
</entry>
<entry>
<title>[rubygems/rubygems] Use spaces around optional parameter values</title>
<updated>2025-08-18T03:31:51+00:00</updated>
<author>
<name>David Rodríguez</name>
<email>deivid.rodriguez@riseup.net</email>
</author>
<published>2025-08-11T20:02:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7125f7635d43f67b1664bf85e72a34d868259822'/>
<id>7125f7635d43f67b1664bf85e72a34d868259822</id>
<content type='text'>
https://github.com/rubygems/rubygems/commit/b58829a868
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/rubygems/rubygems/commit/b58829a868
</pre>
</div>
</content>
</entry>
<entry>
<title>[rubygems/rubygems] Let s3_uri_signer accept the HTTP method</title>
<updated>2025-07-09T04:48:37+00:00</updated>
<author>
<name>Peteris Rudzusiks</name>
<email>rye@stripe.com</email>
</author>
<published>2025-06-19T16:17:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3feba181ed50b2109f35ed8225f3ed1e45bdca93'/>
<id>3feba181ed50b2109f35ed8225f3ed1e45bdca93</id>
<content type='text'>
https://github.com/rubygems/rubygems/commit/35fc7f9547
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/rubygems/rubygems/commit/35fc7f9547
</pre>
</div>
</content>
</entry>
<entry>
<title>[rubygems/rubygems] Correctly sign S3 HEAD requests</title>
<updated>2025-07-09T04:48:36+00:00</updated>
<author>
<name>Peteris Rudzusiks</name>
<email>rye@stripe.com</email>
</author>
<published>2025-06-12T13:59:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5d880b75efe75a2be7046e75ea62bd02e0cf94a5'/>
<id>5d880b75efe75a2be7046e75ea62bd02e0cf94a5</id>
<content type='text'>
We sometimes send HEAD requests. The s3_uri_signer.rb code allways assumed GETs.
This lead to consistently getting 403 responses back from S3. Recently, S3
attempted to change the behaviour of how 403s are handled when TCP connections
are reused,  which escalated this bug from "just noise" to "breaks gem installs".
They've reverted that behaviour, so the severity of this problem is back to
"just noise". Either way, it's a bug in rubygems and warrants a fix it.

https://github.com/rubygems/rubygems/commit/c38f502b73
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We sometimes send HEAD requests. The s3_uri_signer.rb code allways assumed GETs.
This lead to consistently getting 403 responses back from S3. Recently, S3
attempted to change the behaviour of how 403s are handled when TCP connections
are reused,  which escalated this bug from "just noise" to "breaks gem installs".
They've reverted that behaviour, so the severity of this problem is back to
"just noise". Either way, it's a bug in rubygems and warrants a fix it.

https://github.com/rubygems/rubygems/commit/c38f502b73
</pre>
</div>
</content>
</entry>
<entry>
<title>[rubygems/rubygems] Removed unused stringio</title>
<updated>2024-09-04T08:57:17+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2024-09-04T07:07:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=56817865d64e898aac28e644bc44ee4e242f4ceb'/>
<id>56817865d64e898aac28e644bc44ee4e242f4ceb</id>
<content type='text'>
Fixed https://github.com/rubygems/rubygems/pull/7996

https://github.com/rubygems/rubygems/commit/16bfcac883
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixed https://github.com/rubygems/rubygems/pull/7996

https://github.com/rubygems/rubygems/commit/16bfcac883
</pre>
</div>
</content>
</entry>
<entry>
<title>[rubygems/rubygems] Rename wrapper files for vendored libraries with 'vendored_' prefix</title>
<updated>2024-02-26T22:04:04+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2024-01-31T04:49:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d2da774f870ecf51f465dd4081a7349812efaac4'/>
<id>d2da774f870ecf51f465dd4081a7349812efaac4</id>
<content type='text'>
https://github.com/rubygems/rubygems/commit/cfc908c8c1
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/rubygems/rubygems/commit/cfc908c8c1
</pre>
</div>
</content>
</entry>
<entry>
<title>Vendor uri gem in RubyGems</title>
<updated>2024-01-29T03:14:21+00:00</updated>
<author>
<name>David Rodríguez</name>
<email>deivid.rodriguez@riseup.net</email>
</author>
<published>2024-01-15T19:51:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d64d0b54231208c7bec899a7fe8c3b98ec2e9a1b'/>
<id>d64d0b54231208c7bec899a7fe8c3b98ec2e9a1b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[rubygems/rubygems] Vendor timeout in RubyGems too</title>
<updated>2023-12-13T03:16:55+00:00</updated>
<author>
<name>David Rodríguez</name>
<email>deivid.rodriguez@riseup.net</email>
</author>
<published>2023-06-30T19:22:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a7c9163b5d87c0420e54cd75668bceb8f39a578a'/>
<id>a7c9163b5d87c0420e54cd75668bceb8f39a578a</id>
<content type='text'>
https://github.com/rubygems/rubygems/commit/e2e7440ede
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/rubygems/rubygems/commit/e2e7440ede
</pre>
</div>
</content>
</entry>
</feed>
