diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-07-08 22:48:08 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-07-08 22:48:08 +0000 |
commit | e8217abac6638d73d742c3ecfb1c9792b3ef0803 (patch) | |
tree | f08ac7be3aeb6753406e1ef07aefba1726e428e4 | |
parent | 60e5e10ef51f9eed05e7fbeff6866668311de181 (diff) | |
download | puppet-e8217abac6638d73d742c3ecfb1c9792b3ef0803.tar.gz puppet-e8217abac6638d73d742c3ecfb1c9792b3ef0803.tar.xz puppet-e8217abac6638d73d742c3ecfb1c9792b3ef0803.zip |
Hopefully fixing #685 -- I added a wrapper around the call to getconfig(), so any timeouts will just throw an error and skip the run, rather than failing and killing the daemon. This is not the best approach, since really, each method should be wrapped, but it is sufficient.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2658 980ebf18-57e1-0310-9a29-db15c13687c0
-rw-r--r-- | lib/puppet/network/client/master.rb | 8 | ||||
-rwxr-xr-x | test/network/client/master.rb | 15 |
2 files changed, 18 insertions, 5 deletions
diff --git a/lib/puppet/network/client/master.rb b/lib/puppet/network/client/master.rb index ae13f8185..8d141f33f 100644 --- a/lib/puppet/network/client/master.rb +++ b/lib/puppet/network/client/master.rb @@ -300,8 +300,12 @@ class Puppet::Network::Client::Master < Puppet::Network::Client lockfile.lockfile else got_lock = true - @configtime = thinmark do - self.getconfig + begin + @configtime = thinmark do + self.getconfig + end + rescue => detail + Puppet.err "Could not retrieve configuration: %s" % detail end if defined? @objects and @objects diff --git a/test/network/client/master.rb b/test/network/client/master.rb index 87eb22b31..89de171db 100755 --- a/test/network/client/master.rb +++ b/test/network/client/master.rb @@ -618,9 +618,7 @@ end end end - assert_raise(ArgumentError, "did not fail") do - master.run - end + master.run assert(! master.send(:lockfile).locked?, "Master is still locked after failure") @@ -725,6 +723,17 @@ end assert(FileTest.exists?(@createdfile), "File does not exist on disk") assert_nil(ftype[@createdfile], "file object was not removed from memory") end + + # #685 + def test_http_failures_do_not_kill_puppetd + client = mkclient + + client.meta_def(:getconfig) { raise "A failure" } + + assert_nothing_raised("Failure in getconfig threw an error") do + client.run + end + end end # $Id$ |