Skip to content

Commit

Permalink
Merge pull request #9458 from mhashizume/PUP-12062/main/fact-limit
Browse files Browse the repository at this point in the history
Clarify soft limit on number of facts
  • Loading branch information
mhashizume authored Sep 5, 2024
2 parents 5af02da + f7dfc72 commit 7e19ae9
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 @@ -132,7 +132,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 @@ -1805,7 +1805,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 7e19ae9

Please sign in to comment.