diff options
Diffstat (limited to 'lib/puppet/network/xmlrpc/client.rb')
-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) |