Skip to content

Commit 973e2a7

Browse files
authored
Merge pull request #9173 from joshcooper/merge_nov_28
Merge 7.x to main
2 parents bc32a27 + 521808e commit 973e2a7

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

acceptance/tests/resource/service/ticket_5024_systemd_enabling_masked_service.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package_name = {'el' => 'httpd',
1818
'centos' => 'httpd',
1919
'fedora' => 'httpd',
20+
'amazon' => 'httpd',
2021
'sles' => 'apache2',
2122
'debian' => 'cron', # apache2 does not create systemd service symlinks in Debian
2223
'ubuntu' => 'cron', # See https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1447807
@@ -43,13 +44,6 @@
4344
package { '#{package_name[platform]}':
4445
ensure => present,
4546
}
46-
if ($os['name'] == 'Fedora') and ($os['release']['major'] == '23') {
47-
package{'libnghttp2':
48-
ensure => latest,
49-
install_options => '--best',
50-
before => Package['httpd'],
51-
}
52-
}
5347
}
5448
manifest_service_masked = %Q{
5549
service { '#{package_name[platform]}':

lib/puppet/settings.rb

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
require 'forwardable'
77
require 'fileutils'
88
require 'concurrent'
9+
require_relative 'concurrent/lock'
910

1011
# The class for handling configuration files.
1112
class Puppet::Settings
@@ -147,8 +148,21 @@ def initialize
147148
@configuration_file = nil
148149

149150
# And keep a per-environment cache
150-
@cache = Concurrent::Hash.new { |hash, key| hash[key] = Concurrent::Hash.new }
151-
@values = Concurrent::Hash.new { |hash, key| hash[key] = Concurrent::Hash.new }
151+
# We can't use Concurrent::Map because we want to preserve insertion order
152+
@cache_lock = Puppet::Concurrent::Lock.new
153+
@cache = Concurrent::Hash.new do |hash, key|
154+
@cache_lock.synchronize do
155+
break hash[key] if hash.key?(key)
156+
hash[key] = Concurrent::Hash.new
157+
end
158+
end
159+
@values_lock = Puppet::Concurrent::Lock.new
160+
@values = Concurrent::Hash.new do |hash, key|
161+
@values_lock.synchronize do
162+
break hash[key] if hash.key?(key)
163+
hash[key] = Concurrent::Hash.new
164+
end
165+
end
152166

153167
# The list of sections we've used.
154168
@used = []

0 commit comments

Comments
 (0)