Jira (PUP-10946) Recursive file resources generate dangerous numbers of resource events

79 views
Skip to first unread message

Charlie Sharpsteen (Jira)

unread,
Mar 2, 2021, 6:53:56 PM3/2/21
to puppe...@googlegroups.com
Charlie Sharpsteen updated an issue
 
Puppet / Bug PUP-10946
Recursive file resources generate dangerous numbers of resource events
Change By: Charlie Sharpsteen
Priority: Normal Major
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Charlie Sharpsteen (Jira)

unread,
Mar 2, 2021, 6:53:57 PM3/2/21
to puppe...@googlegroups.com
Charlie Sharpsteen moved an issue
Change By: Charlie Sharpsteen
Key: SUP PUP - 2255 10946
Method Found: Customer Feedback
Team: Night's Watch
Workflow: Support Scrum Team Workflow
Issue Type: Task Bug
Project: Support Team Puppet

Charlie Sharpsteen (Jira)

unread,
Mar 2, 2021, 6:53:57 PM3/2/21
to puppe...@googlegroups.com

Jarret Lavallee (Jira)

unread,
Mar 2, 2021, 8:51:02 PM3/2/21
to puppe...@googlegroups.com

zendesk.jira (Jira)

unread,
Mar 3, 2021, 9:42:03 AM3/3/21
to puppe...@googlegroups.com
zendesk.jira updated an issue
Change By: zendesk.jira
Zendesk Ticket Count: 1
Zendesk Ticket IDs: 41998

zendesk.jira (Jira)

unread,
Mar 3, 2021, 9:43:01 AM3/3/21
to puppe...@googlegroups.com
zendesk.jira updated an issue
Change By: zendesk.jira
Zendesk Ticket Count: 1 2
Zendesk Ticket IDs: 41896, 41998

zendesk.jira (Jira)

unread,
Mar 3, 2021, 9:44:01 AM3/3/21
to puppe...@googlegroups.com
zendesk.jira updated an issue
Change By: zendesk.jira
Zendesk Ticket Count: 2 3
Zendesk Ticket IDs: 40977, 41896,41998

zendesk.jira (Jira)

unread,
Mar 3, 2021, 9:45:01 AM3/3/21
to puppe...@googlegroups.com
zendesk.jira updated an issue
Change By: zendesk.jira
Zendesk Ticket Count: 3 4
Zendesk Ticket IDs: 39044, 40977,41896,41998

zendesk.jira (Jira)

unread,
Mar 3, 2021, 9:46:01 AM3/3/21
to puppe...@googlegroups.com
zendesk.jira updated an issue
Change By: zendesk.jira
Zendesk Ticket Count: 4 5
Zendesk Ticket IDs: 37704, 39044,40977,41896,41998

zendesk.jira (Jira)

unread,
Mar 3, 2021, 9:47:01 AM3/3/21
to puppe...@googlegroups.com
zendesk.jira updated an issue
Change By: zendesk.jira
Zendesk Ticket Count: 5 6
Zendesk Ticket IDs: 36746, 37704,39044,40977,41896,41998

zendesk.jira (Jira)

unread,
Mar 3, 2021, 9:48:02 AM3/3/21
to puppe...@googlegroups.com
zendesk.jira updated an issue
Change By: zendesk.jira
Zendesk Ticket Count: 6 7
Zendesk Ticket IDs: 36746, 36888, 37704,39044,40977,41896,41998

zendesk.jira (Jira)

unread,
Mar 3, 2021, 9:49:00 AM3/3/21
to puppe...@googlegroups.com
zendesk.jira updated an issue
Change By: zendesk.jira
Zendesk Ticket Count: 7 8
Zendesk Ticket IDs: 35946, 36746,36888,37704,39044,40977,41896,41998

zendesk.jira (Jira)

unread,
Mar 3, 2021, 9:58:01 AM3/3/21
to puppe...@googlegroups.com
zendesk.jira updated an issue
Change By: zendesk.jira
Zendesk Ticket Count: 8 9
Zendesk Ticket IDs: 35285, 35946,36746,36888,37704,39044,40977,41896,41998

Jarret Lavallee (Jira)

unread,
Mar 3, 2021, 10:36:01 AM3/3/21
to puppe...@googlegroups.com

Jarret Lavallee (Jira)

unread,
Mar 3, 2021, 11:15:02 AM3/3/21
to puppe...@googlegroups.com

Nick Walker (Jira)

unread,
Mar 8, 2021, 11:14:01 AM3/8/21
to puppe...@googlegroups.com
Nick Walker commented on Bug PUP-10946
 
Re: Recursive file resources generate dangerous numbers of resource events

We have a best practice recommendation around recursive file resources.

https://github.com/puppetlabs/best-practices/blob/master/recursive-file-resources.md

I wonder if we can move that more officially into the Puppet documentation and then beyond that if it would make sense to include something like this defined type more officially in Puppet as well or we could just mark it supported on the forge and point to it from the documentation. https://forge.puppet.com/modules/npwalker/recursive_file_permissions

Mihai Buzgau (Jira)

unread,
Mar 17, 2021, 5:58:03 AM3/17/21
to puppe...@googlegroups.com

Mihai Buzgau (Jira)

unread,
Mar 17, 2021, 5:58:04 AM3/17/21
to puppe...@googlegroups.com

zendesk.jira (Jira)

unread,
Mar 19, 2021, 4:56:03 PM3/19/21
to puppe...@googlegroups.com

zendesk.jira (Jira)

unread,
Mar 19, 2021, 4:56:04 PM3/19/21
to puppe...@googlegroups.com
zendesk.jira updated an issue
Change By: zendesk.jira
Zendesk Ticket Count: 9 10
Zendesk Ticket IDs: 35285,35946,36746,36888,37704,39044,40977,41896,41998 ,42904

Mihai Buzgau (Jira)

unread,
Mar 23, 2021, 11:34:03 AM3/23/21
to puppe...@googlegroups.com

Mihai Buzgau (Jira)

unread,
Mar 31, 2021, 5:31:04 AM3/31/21
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: NW - 2021-03-31 , NW - 2021-04-14

Ciprian Badescu (Jira)

unread,
Apr 12, 2021, 9:26:02 AM4/12/21
to puppe...@googlegroups.com
Ciprian Badescu assigned an issue to Ciprian Badescu
Change By: Ciprian Badescu
Assignee: Nick Walker Ciprian Badescu
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Ciprian Badescu (Jira)

unread,
Apr 13, 2021, 5:06:01 AM4/13/21
to puppe...@googlegroups.com
Ciprian Badescu commented on Bug PUP-10946
 
Re: Recursive file resources generate dangerous numbers of resource events

I think this could be fixed by adding a new parameter `max_files` file resource and a check on Fileset constructor, https://github.com/puppetlabs/puppet/blob/b9240c317780df0359eb2451db0a4cb0177a353a/lib/puppet/file_serving/fileset.rb#L52-L53, something like:

   _files = files()
    if _files.size > max_files
      raise ArgumentError.new(_("The directory '%{path}' contains %{entries} entries, which exceeds the limit of %{max_files} specified by the max_files parameter for this resource. The limit may be increased, but be aware that large number of file resources can result in excessive resource consumption and degraded performance. Consider using an alternate method to manage large directory trees") % { path: path, entries: _files.size, max_files: max_files })
    end
  end

The `max_files` default value is important since the same mechanism is used to sync plugins,facts/etc. to the agent and we need a default value high to accommodate PE deployments.

 

 

Mihai Buzgau (Jira)

unread,
Apr 14, 2021, 6:22:03 AM4/14/21
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: NW - 2021-03-31, NW - 2021-04-14 , NW-2021-04-28

Ciprian Badescu (Jira)

unread,
Apr 16, 2021, 9:33:01 AM4/16/21
to puppe...@googlegroups.com
 
Re: Recursive file resources generate dangerous numbers of resource events

I got an implementation from this up, but if we want a default value other than 0 (that will disable the check) we need a way to make sure it will not impact the existing deployments, since this limit will apply to any module or mechanism using file resource to recursively synchronize files.

Ciprian Badescu (Jira)

unread,
Apr 21, 2021, 3:26:03 AM4/21/21
to puppe...@googlegroups.com

Mihai Buzgau (Jira)

unread,
Apr 28, 2021, 5:51:04 AM4/28/21
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: NW - 2021-03-31, NW - 2021-04-14, NW-2021-04-28 , NW-2021-05-19

Ciprian Badescu (Jira)

unread,
Apr 28, 2021, 9:27:05 AM4/28/21
to puppe...@googlegroups.com
 
Re: Recursive file resources generate dangerous numbers of resource events

I updated implementation based on comments from Josh Cooper :
Add a new parameter, `max-files`, to limit the number of resources
that may be created by types supporting recursion(file, tidy).

Default value for `max-files` is 0. In this case a warning is logged
when the number of files exceeds hardcoded soft limit of 1000.

In case `max-files` is set to a value different that 0 and the number
of files is greater than `max-files`, a Puppet::Error is raised and the
resource is marked as failed.

Josh Cooper (Jira)

unread,
Apr 29, 2021, 7:47:04 PM4/29/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
 
Change By: Josh Cooper
Fix Version/s: PUP 7.7.0
Fix Version/s: PUP 6.23.0

Josh Cooper (Jira)

unread,
Apr 29, 2021, 7:47:04 PM4/29/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
May 6, 2021, 1:15:02 PM5/6/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
May 6, 2021, 1:19:02 PM5/6/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Release Notes: Enhancement
Release Notes Summary: By default, the file and tidy resource types will generate a warning on the console and report if puppet tries to manage more than 1000 files when the "recurse" parameter is true. In that situation it is better to use a package or an exec command, respectively, to manage large numbers of files.

In addition, the file and tidy resource types support a new parameter "max_files" that will enforce a hard limit. If the number of recursive files is greater than the limit, then the agent run will fail.

Josh Cooper (Jira)

unread,
May 10, 2021, 5:27:05 PM5/10/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-10946
 
Re: Recursive file resources generate dangerous numbers of resource events

One thing I forgot about is pluginsync is implemented as a recursive file resource, so it's not uncommon to hit the 1000 file limit in a PE deployment. See PE-31966. We should pass `max_files = 0` during pluginsync to avoid the warning, since there isn't anything that a user could do to fix the problem. Eventually we will need to fix pluginsync.

Claire Cadman (Jira)

unread,
May 18, 2021, 10:02:02 AM5/18/21
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages