summaryrefslogtreecommitdiffstats
path: root/lib/puppet/network
diff options
context:
space:
mode:
authorMarkus Roberts <Markus@reality.com>2010-01-21 16:03:26 -0800
committerJames Turnbull <james@lovedthanlost.net>2010-01-24 07:29:49 +1100
commita91c476387887baa5920f5539a7c4acfaf8cecd9 (patch)
treef60946f17d929bf7037ec4dd5102e3e04878913a /lib/puppet/network
parent1a263e27dede28d3844a4f010ab6ce42ef2977b0 (diff)
downloadpuppet-a91c476387887baa5920f5539a7c4acfaf8cecd9.tar.gz
puppet-a91c476387887baa5920f5539a7c4acfaf8cecd9.tar.xz
puppet-a91c476387887baa5920f5539a7c4acfaf8cecd9.zip
Fix for #3088 (catching Exception also traps SystemExit)
Changing rescues from the default to Exception (to catch errors that don't descend from StandardError) had the unintended consequence of catching (and suppressing) SystemExit. This patch restores the behavior of by reraising the exception. Of the other exceptions that fall through the same crack (NoMemoryError, SignalException, LoadError, Interrupt, NotImplementedError, and ScriptError) this patch also reraises NoMemoryError, SignalException, and Interrupt in the same way and leaves the rest captured.
Diffstat (limited to 'lib/puppet/network')
-rw-r--r--lib/puppet/network/http/handler.rb2
-rw-r--r--lib/puppet/network/xmlrpc/client.rb2
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/puppet/network/http/handler.rb b/lib/puppet/network/http/handler.rb
index 65bb0f82c..4d9634f79 100644
--- a/lib/puppet/network/http/handler.rb
+++ b/lib/puppet/network/http/handler.rb
@@ -66,6 +66,8 @@ module Puppet::Network::HTTP::Handler
check_authorization(indirection_request)
send("do_%s" % indirection_request.method, indirection_request, request, response)
+ rescue SystemExit,NoMemoryError,SignalException,Interrupt
+ raise
rescue Exception => e
return do_exception(response, e)
end
diff --git a/lib/puppet/network/xmlrpc/client.rb b/lib/puppet/network/xmlrpc/client.rb
index ee2c008eb..805d99324 100644
--- a/lib/puppet/network/xmlrpc/client.rb
+++ b/lib/puppet/network/xmlrpc/client.rb
@@ -144,6 +144,8 @@ module Puppet::Network
Puppet.debug "Calling %s.%s" % [namespace, method]
begin
call("%s.%s" % [namespace, method.to_s],*args)
+ rescue SystemExit,NoMemoryError,SignalException,Interrupt
+ raise
rescue Exception => detail
retry if self.class.error_handler(detail).execute(self, detail, namespace, method) == :retry
end