diff --git a/src/bosh_azure_cpi/lib/cloud/azure/restapi/azure_client.rb b/src/bosh_azure_cpi/lib/cloud/azure/restapi/azure_client.rb index 76e52c81b..4fc745c9d 100644 --- a/src/bosh_azure_cpi/lib/cloud/azure/restapi/azure_client.rb +++ b/src/bosh_azure_cpi/lib/cloud/azure/restapi/azure_client.rb @@ -2461,7 +2461,7 @@ def http_get_response_with_network_retry(http_handler, request) end raise e rescue OpenSSL::SSL::SSLError, OpenSSL::X509::StoreError => e - if retry_count < AZURE_MAX_RETRY_COUNT && e.inspect.include?(ERROR_OPENSSL_RESET) + if retry_count < AZURE_MAX_RETRY_COUNT && [ERROR_OPENSSL_RESET, ERROR_OPENSSL_EOF_READ].any? { |error| e.inspect.include?(error) } retry_count += 1 @logger.warn(format(error_msg_format, retry_count: retry_count, retry_after: retry_after, error: e.class.name)) sleep(retry_after) diff --git a/src/bosh_azure_cpi/lib/cloud/azure/storage/blob_manager.rb b/src/bosh_azure_cpi/lib/cloud/azure/storage/blob_manager.rb index 65ff55abb..378ee78e9 100644 --- a/src/bosh_azure_cpi/lib/cloud/azure/storage/blob_manager.rb +++ b/src/bosh_azure_cpi/lib/cloud/azure/storage/blob_manager.rb @@ -492,7 +492,7 @@ def apply_retry_policy(retry_data) if retry_data[:error].is_a?(OpenSSL::SSL::SSLError) || retry_data[:error].is_a?(OpenSSL::X509::StoreError) error_message = retry_data[:error].inspect - if error_message.include?(Bosh::AzureCloud::Helpers::ERROR_OPENSSL_RESET) + if [Bosh::AzureCloud::Helpers::ERROR_OPENSSL_RESET, Bosh::AzureCloud::Helpers:ERROR_OPENSSL_EOF_READ].any? { |error| error_message.include?(error) } # Retry on "Connection reset by peer - SSL_connect" error (OpenSSL::SSL::SSLError, OpenSSL::X509::StoreError) # https://github.com/cloudfoundry/bosh-azure-cpi-release/issues/234 retry_data[:retryable] = true diff --git a/src/bosh_azure_cpi/lib/cloud/azure/utils/helpers.rb b/src/bosh_azure_cpi/lib/cloud/azure/utils/helpers.rb index 753c0b40a..12a1a97d6 100644 --- a/src/bosh_azure_cpi/lib/cloud/azure/utils/helpers.rb +++ b/src/bosh_azure_cpi/lib/cloud/azure/utils/helpers.rb @@ -135,6 +135,7 @@ module Helpers # REST Connection Errors ERROR_OPENSSL_RESET = 'SSL_connect' + ERROR_OPENSSL_EOF_READ = 'SSL_read' ERROR_SOCKET_UNKNOWN_HOSTNAME = 'Hostname not known' ERROR_CONNECTION_REFUSED = 'Connection refused'