From 288e27899bbf6c44b4d6b13e95272a5d1f608b2a Mon Sep 17 00:00:00 2001 From: k0kubun Date: Sat, 18 Aug 2018 02:04:44 +0000 Subject: [PATCH] tool/downloader.rb: retry 500 from GitHub Unfortunately, GitHub may return 500 for temporary failure: https://travis-ci.org/ruby/ruby/builds/417246523 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- tool/downloader.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tool/downloader.rb b/tool/downloader.rb index 23c81ee6cb..bf5498f42d 100644 --- a/tool/downloader.rb +++ b/tool/downloader.rb @@ -272,7 +272,7 @@ class Downloader begin block.call rescue Errno::ETIMEDOUT, SocketError, OpenURI::HTTPError => e - raise if e.is_a?(OpenURI::HTTPError) && e.message !~ /^50[23] / # retry only 502, 503 for http error + raise if e.is_a?(OpenURI::HTTPError) && e.message !~ /^50[023] / # retry only 500, 502, 503 for http error times += 1 if times <= max_times $stderr.puts "retrying #{e.class} (#{e.message}) after #{times ** 2} seconds..."