diff options
author | Luke Kanies <luke@madstop.com> | 2007-11-23 20:00:47 -0600 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2007-11-23 20:00:47 -0600 |
commit | 38b970a36b0ffd77a4487c34096d6f460e0622df (patch) | |
tree | ac43354660c1c39ce226c073e9a495b64e1aad1c /lib | |
parent | 276034fc24ab7d00ec40564a7c3cad88bd7f60db (diff) | |
download | puppet-38b970a36b0ffd77a4487c34096d6f460e0622df.tar.gz puppet-38b970a36b0ffd77a4487c34096d6f460e0622df.tar.xz puppet-38b970a36b0ffd77a4487c34096d6f460e0622df.zip |
Adding patch 20070927050018-6856b-7fa134180aceb9cee2e667630345f5f8467a9d0c.patch from womble -- Catch more retryable errors in the XMLRPC call wrapper
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/network/xmlrpc/client.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/puppet/network/xmlrpc/client.rb b/lib/puppet/network/xmlrpc/client.rb index 83d4cf203..a4df4fec8 100644 --- a/lib/puppet/network/xmlrpc/client.rb +++ b/lib/puppet/network/xmlrpc/client.rb @@ -43,6 +43,11 @@ module Puppet::Network begin call("%s.%s" % [namespace, method.to_s],*args) rescue OpenSSL::SSL::SSLError => detail + if detail.message =~ /bad write retry/ + Puppet.warning "Transient SSL write error; restarting connection and retrying" + self.recycle_connection(@cert_client) + retry + end raise XMLRPCClientError, "Certificates were not trusted: %s" % detail rescue ::XMLRPC::FaultException => detail @@ -59,11 +64,15 @@ module Puppet::Network ) error.set_backtrace detail.backtrace raise error - rescue Errno::EPIPE + rescue Errno::EPIPE, EOFError Puppet.warning "Other end went away; restarting connection and retrying" self.recycle_connection(@cert_client) retry rescue => detail + if detail.message =~ /^Wrong size\. Was \d+, should be \d+$/ + Puppet.warning "XMLRPC returned wrong size. Retrying." + retry + end Puppet.err "Could not call %s.%s: %s" % [namespace, method, detail.inspect] error = XMLRPCClientError.new(detail.to_s) |