diff --git a/acceptance/tests/resource/service/ticket_5024_systemd_enabling_masked_service.rb b/acceptance/tests/resource/service/ticket_5024_systemd_enabling_masked_service.rb index 8c989ea0dd7..30ce975d864 100644 --- a/acceptance/tests/resource/service/ticket_5024_systemd_enabling_masked_service.rb +++ b/acceptance/tests/resource/service/ticket_5024_systemd_enabling_masked_service.rb @@ -17,6 +17,7 @@ package_name = {'el' => 'httpd', 'centos' => 'httpd', 'fedora' => 'httpd', + 'amazon' => 'httpd', 'sles' => 'apache2', 'debian' => 'cron', # apache2 does not create systemd service symlinks in Debian 'ubuntu' => 'cron', # See https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1447807 @@ -43,13 +44,6 @@ package { '#{package_name[platform]}': ensure => present, } - if ($os['name'] == 'Fedora') and ($os['release']['major'] == '23') { - package{'libnghttp2': - ensure => latest, - install_options => '--best', - before => Package['httpd'], - } - } } manifest_service_masked = %Q{ service { '#{package_name[platform]}': diff --git a/lib/puppet/settings.rb b/lib/puppet/settings.rb index bde9f7875a4..9876ffc7b80 100644 --- a/lib/puppet/settings.rb +++ b/lib/puppet/settings.rb @@ -6,6 +6,7 @@ require 'forwardable' require 'fileutils' require 'concurrent' +require_relative 'concurrent/lock' # The class for handling configuration files. class Puppet::Settings @@ -147,8 +148,21 @@ def initialize @configuration_file = nil # And keep a per-environment cache - @cache = Concurrent::Hash.new { |hash, key| hash[key] = Concurrent::Hash.new } - @values = Concurrent::Hash.new { |hash, key| hash[key] = Concurrent::Hash.new } + # We can't use Concurrent::Map because we want to preserve insertion order + @cache_lock = Puppet::Concurrent::Lock.new + @cache = Concurrent::Hash.new do |hash, key| + @cache_lock.synchronize do + break hash[key] if hash.key?(key) + hash[key] = Concurrent::Hash.new + end + end + @values_lock = Puppet::Concurrent::Lock.new + @values = Concurrent::Hash.new do |hash, key| + @values_lock.synchronize do + break hash[key] if hash.key?(key) + hash[key] = Concurrent::Hash.new + end + end # The list of sections we've used. @used = []