Skip to content

Commit

Permalink
one more pass
Browse files Browse the repository at this point in the history
  • Loading branch information
mattBrzezinski committed Mar 20, 2023
1 parent 5b62567 commit 5b6c716
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/utilities/downloads_backend.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function _http_request(backend::DownloadsBackend, request::Request, response_str

check = (s, e) -> begin
if isa(e, HTTP.StatusError) && AWS._http_status(e) >= 500
@debug "AWS.jl Downloads inner retry for status >= 500" retry=true reason="status >= 500" status=_http_status(e) exception=e
@debug "AWS.jl Downloads inner retry for status >= 500" retry=true reason="status >= 500" status=AWS._http_status(e) exception=e
return true
elseif isa(e, Downloads.RequestError)
@debug "AWS.jl Downloads inner retry for Downloads.RequestError" retry=true reason="Downloads.RequestError" exception=e
Expand Down
15 changes: 4 additions & 11 deletions src/utilities/request.jl
Original file line number Diff line number Diff line change
Expand Up @@ -256,25 +256,18 @@ function _http_request(http_backend::HTTPBackend, request::Request, response_str
delays = AWSExponentialBackoff(; max_attempts=4)

check = (s, e) -> begin
# `Base.IOError` is needed because HTTP.jl can often have errors that aren't
# caught and wrapped in an `HTTP.IOError`
# https://github.com/JuliaWeb/HTTP.jl/issues/382
errors = (Sockets.DNSError, HTTP.ParseError, HTTP.IOError, Base.IOError)
errors = (Sockets.DNSError, HTTP.ParseError, Base.IOError)
for error in errors
if isa(e, error)
@debug "AWS.jl HTTP inner retry for $error" retry = true reason = "$error" exception =
e
@debug "AWS.jl HTTP inner retry for $error" retry=true reason="$error" exception=e
return true
end
end
if (isa(e, HTTP.StatusError) && _http_status(e) >= 500)
@debug "AWS.jl HTTP inner retry for status >= 500" retry = true reason = "status >= 500" status = AWS._http_status(
e
) exception = e
@debug "AWS.jl HTTP inner retry for status >= 500" retry=true reason="status >= 500" status=_http_status(e) exception=e
return true
end
@debug "AWS.jl HTTP inner retry declined" retry = false reason = "Exception passed onwards" exception =
e
@debug "AWS.jl HTTP inner retry declined" retry=false reason="Exception passed onwards" exception=e
return false
end

Expand Down

0 comments on commit 5b6c716

Please sign in to comment.