File tree Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ Bug fixes:
73
73
* Fixed issue with installing latest bundler (#1880 ).
74
74
* Fixed type conversion for ` Numeric#step ` ` step ` parameter.
75
75
* Fixed ` Kernel#Integer ` conversion.
76
+ * Avoid race conditions during ` gem install ` by using a single download thread.
76
77
77
78
Compatibility:
78
79
Original file line number Diff line number Diff line change @@ -44,7 +44,12 @@ class Gem::ConfigFile
44
44
DEFAULT_BULK_THRESHOLD = 1000
45
45
DEFAULT_VERBOSITY = true
46
46
DEFAULT_UPDATE_SOURCES = true
47
- DEFAULT_CONCURRENT_DOWNLOADS = 8
47
+ if defined? ( ::TruffleRuby )
48
+ # GR-18264: Gem::Specification._all does not seem thread safe and raises "nil spec! included in"
49
+ DEFAULT_CONCURRENT_DOWNLOADS = 1
50
+ else
51
+ DEFAULT_CONCURRENT_DOWNLOADS = 8
52
+ end
48
53
DEFAULT_CERT_EXPIRATION_LENGTH_DAYS = 365
49
54
50
55
##
Original file line number Diff line number Diff line change
1
+ # Copyright (c) 2020 Oracle and/or its affiliates. All rights reserved. This
2
+ # code is released under a tri EPL/GPL/LGPL license. You can use it,
3
+ # redistribute it and/or modify it under the terms of the:
4
+ #
5
+ # Eclipse Public License version 2.0, or
6
+ # GNU General Public License version 2, or
7
+ # GNU Lesser General Public License version 2.1.
8
+ # OTHER DEALINGS IN THE SOFTWARE.
9
+
10
+ require_relative '../../ruby/spec_helper'
11
+ require 'rubygems'
12
+
13
+ describe "Downloading gems with RubyGems" do
14
+ it "is thread-safe by using a single thread to fetch (GR-18264)" do
15
+ Gem . configuration . concurrent_downloads . should == 1
16
+ end
17
+ end
You can’t perform that action at this time.
0 commit comments