Skip to content

Commit

Permalink
Merge pull request #9474 from puppetlabs/backport-9458-to-7.x
Browse files Browse the repository at this point in the history
[Backport 7.x] Clarify soft limit on number of facts
  • Loading branch information
mhashizume committed Sep 5, 2024
2 parents 3e6ed12 + 87eec4c commit 68d9ac4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/puppet/configurer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def convert_catalog(result, duration, facts, options = {})
end

def warn_number_of_facts(size, max_number)
Puppet.warning _("The current total number of facts: %{size} exceeds the number of facts limit: %{max_size}") % { size: size, max_size: max_number }
Puppet.warning _("The current total number of fact values: %{size} exceeds the fact values limit: %{max_size}") % { size: size, max_size: max_number }
end

def warn_fact_name_length(name, max_length)
Expand Down
4 changes: 3 additions & 1 deletion lib/puppet/defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1768,7 +1768,9 @@ def self.initialize_default_settings!(settings)
:number_of_facts_soft_limit => {
:default => 2048,
:type => :integer,
:desc => "The soft limit for the total number of facts.",
:desc => "The soft limit for the total number of fact values. This counts the
child elements of all facts (e.g. all items of an array or a hash), not just top
level facts.",
},
:payload_soft_limit => {
:default => 16 * 1024 * 1024,
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/configurer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
}
Puppet::Node::Facts.indirection.save(facts)

expect(Puppet).to receive(:warning).with(/The current total number of facts: [1-9]* exceeds the number of facts limit: [1-9]*/)
expect(Puppet).to receive(:warning).with(/The current total number of fact values: [1-9]* exceeds the fact values limit: [1-9]*/)
configurer.run
end

Expand Down

0 comments on commit 68d9ac4

Please sign in to comment.