summaryrefslogtreecommitdiff
path: root/lib/chef
diff options
context:
space:
mode:
authorRamachandra Joshi <rgjoshi24@gmail.com>2021-08-27 15:44:46 +0000
committerGitHub <noreply@github.com>2021-08-27 11:44:46 -0400
commit19a2a0262ab9ffb1b774f7af8cab55fe3bfbfabe (patch)
tree9870fc052bf1c1ff9c344b5551a2de2ef08823ad /lib/chef
parentd2ae464c99e5de9e1778c8aa4444364fd10e7277 (diff)
downloadchef-19a2a0262ab9ffb1b774f7af8cab55fe3bfbfabe.tar.gz
Downgrade http retry log level to warning
Because we are retrying, it is not an error. If we fail the retries we raise an exception, which will log at the error or fatal level. See also [INFRA-I-25](https://chef-software.ideas.aha.io/ideas/INFRA-I-25)
Diffstat (limited to 'lib/chef')
-rw-r--r--lib/chef/http.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/chef/http.rb b/lib/chef/http.rb
index 162998b7f3..00e1d2bd50 100644
--- a/lib/chef/http.rb
+++ b/lib/chef/http.rb
@@ -423,7 +423,7 @@ class Chef
if response.is_a?(Net::HTTPServerError) && !Chef::Config.local_mode
if http_retry_count - http_attempts >= 0
sleep_time = 1 + (2**http_attempts) + rand(2**http_attempts)
- Chef::Log.error("Server returned error #{response.code} for #{url}, retrying #{http_attempts}/#{http_retry_count} in #{sleep_time}s")
+ Chef::Log.warn("Server returned error #{response.code} for #{url}, retrying #{http_attempts}/#{http_retry_count} in #{sleep_time}s") # Updated from error to warn
sleep(sleep_time)
redo
end
@@ -432,7 +432,7 @@ class Chef
end
rescue SocketError, Errno::ETIMEDOUT, Errno::ECONNRESET => e
if http_retry_count - http_attempts >= 0
- Chef::Log.error("Error connecting to #{url}, retry #{http_attempts}/#{http_retry_count}")
+ Chef::Log.warn("Error connecting to #{url}, retry #{http_attempts}/#{http_retry_count}") # Updated from error to warn
sleep(http_retry_delay)
retry
end
@@ -440,21 +440,21 @@ class Chef
raise e
rescue Errno::ECONNREFUSED
if http_retry_count - http_attempts >= 0
- Chef::Log.error("Connection refused connecting to #{url}, retry #{http_attempts}/#{http_retry_count}")
+ Chef::Log.warn("Connection refused connecting to #{url}, retry #{http_attempts}/#{http_retry_count}") # Updated from error to warn
sleep(http_retry_delay)
retry
end
raise Errno::ECONNREFUSED, "Connection refused connecting to #{url}, giving up"
rescue Timeout::Error
if http_retry_count - http_attempts >= 0
- Chef::Log.error("Timeout connecting to #{url}, retry #{http_attempts}/#{http_retry_count}")
+ Chef::Log.warn("Timeout connecting to #{url}, retry #{http_attempts}/#{http_retry_count}") # Updated from error to warn
sleep(http_retry_delay)
retry
end
raise Timeout::Error, "Timeout connecting to #{url}, giving up"
rescue OpenSSL::SSL::SSLError => e
if (http_retry_count - http_attempts >= 0) && !e.message.include?("certificate verify failed")
- Chef::Log.error("SSL Error connecting to #{url}, retry #{http_attempts}/#{http_retry_count}")
+ Chef::Log.warn("SSL Error connecting to #{url}, retry #{http_attempts}/#{http_retry_count}") # Updated from error to warn
sleep(http_retry_delay)
retry
end