Bug #11641
After 2.7.9 update, Tidy resource can only tidy a single file per run
| Status: | Closed | Start date: | 12/29/2011 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | % Done: | 0% |
||
| Category: | tidy | |||
| Target version: | 2.7.10 | |||
| Affected Puppet version: | 2.7.9 | Branch: | ||
| Keywords: | ||||
| Votes: | 0 |
Description
We use the Tidy resource to clean up old apt files from /var/cache/apt/archives, and after upgrading from 2.7.6 to 2.7.9, it is no longer able to tidy more than file per Puppet agent run. I now receive a warning that says “appears to have a negative number of dependencies”
... notice: /Stage[main]/Apt::Cleaner/Tidy[/var/cache/apt/archives]: Tidying File[/var/cache/apt/archives/libaprutil1_1.3.9+dfsg-3ubuntu0.10.04.1_i386.deb] notice: /Stage[main]/Apt::Cleaner/Tidy[/var/cache/apt/archives]: Tidying File[/var/cache/apt/archives/postfix-pcre_2.7.0-1ubuntu0.2_i386.deb] notice: /Stage[main]/Apt::Cleaner/Tidy[/var/cache/apt/archives]: Tidying File[/var/cache/apt/archives/pflogsumm_1.1.2-2_all.deb] info: Applying configuration version 'fabric-rterhaar-master-1325104418' notice: /File[/var/cache/apt/archives/snmpd_5.4.2.1~dfsg0ubuntu1-0ubuntu2.1_i386.deb]/ensure: removed warning: /Stage[main]/Apt::Cleaner/Tidy[/var/cache/apt/archives]: appears to have a negative number of dependencies warning: Class[Apt::Cleaner]: appears to have a negative number of dependencies ...
The Tidy resource code that generates this error is very simple:
tidy{'/var/cache/apt/archives':
age => '1d',
rmdirs => false,
recurse => true,
matches => '*.deb',
}
History
Updated by Josh Cooper 5 months ago
- Category set to tidy
- Status changed from Unreviewed to Accepted
- Assignee set to Nick Lewis
- Target version set to 2.7.x
Hi Rob, Thanks for reporting this. It’s definitely one of those cases that should never happen. We’ll look into it. For reference this issue was introduced with the fix for #9671
Updated by Nick Lewis 5 months ago
- Status changed from Accepted to In Topic Branch Pending Review
Pull request 297 addresses this.
We were previously calculating blockers and enqueuing ready resources whenever they were initially added to the catalog, then coming along and generating additional resources without considering how those might affect blockedness. However, unlike the eval_generate case, which happens during the middle of traversal (and thus we already know which resources are ready), tidy resources are generated before traversal, and so clearing blockers would leave us with nothing to run. So instead, we now just defer calculating blockers and enqueuing our initial ready set until we’re done generating additional resources. This is a bit safer anyway, as it moves the initial enqueue immediately before we start reading from the ready list, and thus limits the possibility of other errors like this creeping in.
I couldn’t figure out a reasonable way to write specs for this, so I’ve added an acceptance test for tidy, which should help in other ways in the future (tidy is a weird edge case of a type in many ways).
Updated by Rob Terhaar 4 months ago
It looks like 2.7.10 is getting close to release, is there a chance that this will make it into the release?
Updated by Daniel Pittman 4 months ago
- Status changed from In Topic Branch Pending Review to Merged - Pending Release
- Target version changed from 2.7.x to 2.7.10
Updated by Michael Stahnke 4 months ago
- Status changed from Merged - Pending Release to Closed
released in 2.7.10rc1