puppetlabs/puppet — pull request #2985 by cprice404 (2014-08-17 04:28:48+00:00)
Title: (PUP-3032) Add setting to always cache `feature` load attempts

This commit adds a new setting, :always_cache_features, which affects
how we cache attempts to load Puppet 'features'. If false, then
calls to `Puppet.features.?` will always attempt to load the
feature (which can be an expensive operation) unless it has already been
loaded successfully. This makes it possible for a single agent run to,
e.g., install a package that provides the underlying capabilities for
a feature, and then later load that feature during the same run (even if
the feature had been tested earlier and had not been available).

If this setting is set to true, then features will only be checked once,
and if they are not available, the negative result is cached and returned
for all subsequent attempts to load the feature. This behavior is almost
always appropriate for the server, and can result in a significant performance
improvement for features that are checked frequently.