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
This commit is contained in:
Родитель
60e5e10ef5
Коммит
e8217abac6
|
@ -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
|
||||
|
|
|
@ -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$
|
||||
|
|
Загрузка…
Ссылка в новой задаче