Issue #22944 has been updated by Glenn Poston.

I think that the title of this ticket undermines it's serverity, so I just 
wanted to add some research that I did.

I have an external fact (script) that takes 5s to evaluate.  This causes my 
puppet runs to take 2x longer than they do without the fact evaluation.  This 
doubles our run time.  We use puppet to provision new instances for 
auto-scaling purposes, so puppet run times are critical for us.  Here's some 
data:

I was curious how much of an effect the long running external fact was 
effecting the timing, so I updated the external fact script to simply echo the 
content (instead of fetching it from s3).  The facts it produced were the same 
as if it had fetched the facts from S3.

I then introduced a 'sleep x' before the echo statement in the script.  Now we 
see some compounding delays.  I think this adds a bit of support to the theory 
that puppet is unnecessarily re-evaluating facts, but it appears that facter 
may have some compounding delays as well.

Bottom Line:

When the script resolves instantaneously (echo statment only)
script takes .004s
facter takes .754s
puppet takes 1m

When the script takes 1s (sleep 1, then echo)
script takes 1s
facter takes 6s
puppet takes 1m12s

When the script takes 5s (sleep 5, then echo)
script takes 5s
facter takes 30s
puppet takes 2m38s


----------------------------------------
Bug #22944: External facts are evaluated many times
https://projects.puppetlabs.com/issues/22944#change-100328

* Author: Matthias Baur
* Status: Accepted
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 1.7.4
* Keywords: 
* Branch: 
* Affected Facter version: 1.7.3
----------------------------------------
** Reproduction **

* Drop script /etc/facter/facts.d/test.sh:
<pre>
#!/bin/bash
echo "SCRIPT CALLED" >&2
echo "test=value"
</pre>
* Make script executeable
<pre>
chmod +x /etc/facter/facts.d/test.sh
</pre>
* Call 'facter', the following output is shown:
<pre>
root@puppet:~# facter
SCRIPT CALLED
SCRIPT CALLED
SCRIPT CALLED
SCRIPT CALLED
SCRIPT CALLED
SCRIPT CALLED
...
Regular facter output
...
</pre>

I don't see a reason why the script is called 6 times.

System information

* Ubuntu 12.04.3
* Facter 1.7.3


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to