Jira (PUP-11685) Total number of fact warning not counting array elements

12 views
Skip to first unread message

Sean Millichamp (Jira)

unread,
Dec 5, 2022, 10:19:02 AM12/5/22
to puppe...@googlegroups.com
Sean Millichamp created an issue
 
Puppet / Bug PUP-11685
Total number of fact warning not counting array elements
Issue Type: Bug Bug
Affects Versions: PUP 7.20.0
Assignee: Unassigned
Created: 2022/12/05 7:18 AM
Priority: Normal Normal
Reporter: Sean Millichamp

The "Total number of facts exceeds" warning generated from https://github.com/puppetlabs/puppet/blob/main/lib/puppet/configurer.rb#L190 seems to incorrectly count the total number of facts.

A fact which returns a Hash containing hashes (Hash[String, Hash]) will result in each hash entry being counted. A fact which returns an Array of Hashes, say (Array[Hash[String, Scalar]), will result in each element in the array being counted.

However, an array consisting of scalar entries (Array[Scalar]) will only count as one fact entry.

This behavior seems inconsistent, a bit confusing and nowhere have I found clear documentation on exactly what should count toward the maximum fact count nor the optimal data structure to use if we just can't avoid returning a very large number of structured elements (e.g. is it an Array[Hash], a Hash[String, Hash], something else? or maybe there is no significant difference?)

If the fact check is either overcounting (Hashes in Arrays) or undercounting (Scalars in Arrays) then it should be corrected. If the current behavior is correct then it would be great to get some documentation on what is "good" and what is "bad" for very large facts.

Thanks!

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8)
Atlassian logo

Morgan Rhodes (Jira)

unread,
Dec 6, 2022, 4:12:02 PM12/6/22
to puppe...@googlegroups.com

Morgan Rhodes (Jira)

unread,
Dec 6, 2022, 4:12:03 PM12/6/22
to puppe...@googlegroups.com

Vadym Chepkov (Jira)

unread,
Jan 27, 2023, 4:21:03 PM1/27/23
to puppe...@googlegroups.com
Vadym Chepkov commented on Bug PUP-11685
 
Re: Total number of fact warning not counting array elements

I stepped on this issue on puppet 7.20 as well, not a problem on puppet 6

Vadym Chepkov (Jira)

unread,
Jan 30, 2023, 10:27:02 AM1/30/23
to puppe...@googlegroups.com

FYI, puppet/systemd v4 exposes this flaw to all nodes

Reply all
Reply to author
Forward
0 new messages