mirror of
https://github.com/ruby/ruby.git
synced 2026-08-01 02:20:48 +08:00
[ruby/rubygems] Update the versions file before fetching infos in parallel
When the compact index client has been released after resolution and is lazily rebuilt, for example by bundle cache --all-platforms, its first use happens inside the parallel fetch workers. They then race to create the client and update the versions file, whose temp file name is based on the pid, so concurrent renames fail with ENOENT, the fetcher falls back to an empty index, and caching crashes on an unmaterialized LazySpecification. Warm the client up on the calling thread instead. https://github.com/ruby/rubygems/commit/0649eb11ed Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
dc70cf987c
commit
8713805e6b
@ -80,6 +80,12 @@ module Bundler
|
||||
end
|
||||
|
||||
def fetch_gem_infos(names)
|
||||
# Create the client and update the versions file on this thread.
|
||||
# Otherwise the workers race to lazily create the client and update
|
||||
# the versions file concurrently, e.g. when the client was released
|
||||
# after resolution and is being rebuilt for `bundle cache`.
|
||||
compact_index_client.available?
|
||||
|
||||
in_parallel(names) {|name| compact_index_client.info(name) }
|
||||
rescue TooManyRequestsError # rubygems.org is rate limiting us, slow down.
|
||||
@bundle_worker&.stop
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user