Trevor,

We've thought about a daemonized facterd, and it's in our vision. This is
the first step along that path.  With Facter as both an executable and a
library, it turns out to be really hard to be able to guarantee that a
value will definitely be returned within a certain amount of time *and* if
it takes longer than that reliably spawn something that will resolve the
fact and store it in a cache. By pulling out the cache to a file, it
defines a specific interface for those that need fast access to facts even
though they may be slightly out-dated. With the file as the interface, we
have the opportunity to create and improve a facterd without breaking
people who are using the yaml cache.

So, short story even longer, we agree that you thoughts are roughly in-line
with where we are going, but we need to take the first step, and this seems
like a reasonable first step that will allow us some freedom to experiment
without breaking users of the cache.

--Jeff

On Wed, May 23, 2012 at 3:51 PM, Trevor Vaughan <[email protected]>wrote:

> Just thinking out loud here but how about a daemonized process
> (facterd?) that allows for fine grained retrieval of facts and solves
> your concurrency issues with an internal mechanism?
>
> Should facterd be unavailable, each process should be able to fall
> back to a) gathering all facts or b) reading the cache file and
> updating those items that have elapsed.
>
> This way you end up with something like (for example):
>
> os_version => '4 months'
> uptime => 'no cache'
> ps => 'persist'
> etc...
>
> The issue with some of these is that, while they won't change often,
> when they change you *really* want to know. Like puppet_version and
> ruby_version and possibly ipaddress.
>
> A prod to the daemon with a USR1 (or whatever) should force a re-cache
> of items selected as such.
>
> Having a daemon process could also allow for asynchronous fact
> collection via SNMP/REST/Whatever....
>
> Those are my initial thoughts anyway.
>
> Trevor
>
> On Wed, May 23, 2012 at 6:31 PM, Hailee Kenney <[email protected]>
> wrote:
> > We are implementing caching in Facter, and are looking for feedback on
> how
> > we've decided to do so. As further described in this ticket, we've
> deciding
> > against an internal cache because it's really hard to get right in
> > a concurrent environment.
> >
> > Our supported interface will be a simple yaml file on disk using only
> > key/value pairs with out-of-band updates.
> >
> > This will allow us to decouple the cache from the implementation of
> updating
> > the cache, which will allow us to potentially transition to a daemonized
> > version of Facter which can do piecemeal expiration of individual facts
> > rather than replacement of the entire cache. The update method today
> might
> > be cron, but it allows us some flexibility it how we do the updates.
> >
> > This method has been proven effective in MCollective.
> >
> > We know we have some slow fact resolutions, this is not meant to bypass
> > those, we'll still need to investigate and solve those issues.
> >
> > --
> > Hailee Kenney
> > Development Intern
> > Puppet Labs, Inc.
> > [email protected]
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Puppet Developers" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected].
> > For more options, visit this group at
> > http://groups.google.com/group/puppet-dev?hl=en.
>
>
>
> --
> Trevor Vaughan
> Vice President, Onyx Point, Inc
> (410) 541-6699
> [email protected]
>
> -- This account not approved for unencrypted proprietary information --
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Developers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/puppet-dev?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to