diff options
| author | Markus Roberts <Markus@reality.com> | 2009-10-19 21:51:32 -0700 |
|---|---|---|
| committer | James Turnbull <james@lovedthanlost.net> | 2009-11-13 18:34:37 +1100 |
| commit | adc0a4ed939a717e8735485d493bde28ceab5ac0 (patch) | |
| tree | 3d8191c9d84a94a47859b194c3cc79eed83db33f /lib/puppet/configurer | |
| parent | 65f601a99a0ca7ebacfda7a6becd8af9fe9eaacb (diff) | |
| download | puppet-adc0a4ed939a717e8735485d493bde28ceab5ac0.tar.gz puppet-adc0a4ed939a717e8735485d493bde28ceab5ac0.tar.xz puppet-adc0a4ed939a717e8735485d493bde28ceab5ac0.zip | |
Fix for #2661 and related issues
If setup code for a process depends on network connectivity
it needs to be protected with a rescue clause as much as the
main body of the process.
Further, Timeout exceptions aren't under StandardError and thus
aren't caught by an un-typed rescue clause. This doesn't matter
if we've morphed the exception, but will cause the program to
fail if we haven't.
There are many places where these concerns _might_ cause a problem
but in most cases they never will in practice; this patch addresses
the five cases where I have been able to confirm that it actually
can cause the client daemon to exit and two more where I suspect
(but can not prove) that it could.
This is an extension of the prior patch to cover additional cases
found by automated testing (repeated catalog runs with a 1% chance
of timeout forced on all timeout-bound operations, ~5000 runs).
The new cases recurred multiple times (>100 each) and in a final pass
with these corrected (~2500 runs) no additional cases were found.
Diffstat (limited to 'lib/puppet/configurer')
| -rw-r--r-- | lib/puppet/configurer/fact_handler.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/puppet/configurer/fact_handler.rb b/lib/puppet/configurer/fact_handler.rb index 8e0fef71d..cbb627680 100644 --- a/lib/puppet/configurer/fact_handler.rb +++ b/lib/puppet/configurer/fact_handler.rb @@ -11,14 +11,13 @@ module Puppet::Configurer::FactHandler end def find_facts - reload_facter() - # This works because puppetd configures Facts to use 'facter' for # finding facts and the 'rest' terminus for caching them. Thus, we'll # compile them and then "cache" them on the server. begin + reload_facter() Puppet::Node::Facts.find(Puppet[:certname]) - rescue => detail + rescue Exception => detail puts detail.backtrace if Puppet[:trace] raise Puppet::Error, "Could not retrieve local facts: %s" % detail end |
