Skip to content

Commit

Permalink
Merge #543
Browse files Browse the repository at this point in the history
543: Retry 500 errors more times r=mattBrzezinski a=ericphanson

Closes #542

Co-authored-by: Eric Hanson <[email protected]>
  • Loading branch information
bors[bot] and ericphanson authored May 11, 2022
2 parents bf568c3 + 3e62ff8 commit e0210cd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "AWS"
uuid = "fbe9abb3-538b-5e4e-ba9e-bc94f4f92ebc"
license = "MIT"
version = "1.74.1"
version = "1.74.2"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/downloads_backend.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function _http_request(backend::DownloadsBackend, request::Request, response_str
local buffer
local response
try
@repeat 4 try
@repeat 10 try
# Use a sacrificial I/O stream so that we only write the `response_stream` once
# even with multiple attempts.
buffer = Base.BufferStream()
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/request.jl
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ function _http_request(http_backend::HTTPBackend, request::Request, response_str
local buffer
local response
try
@repeat 4 try
@repeat 10 try
# Use a sacrificial I/O stream so that we only write to the `response_stream`
# once even with multiple attempted requests. Additionally this works around the
# HTTP.jl issue (https://github.com/JuliaWeb/HTTP.jl/issues/543) where the
Expand Down
6 changes: 3 additions & 3 deletions test/issues.jl
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ try

# https://github.com/JuliaCloud/AWS.jl/issues/515
@testset "issue 515" begin
function _incomplete_patch(; data, num_attempts_to_fail=4)
function _incomplete_patch(; data, num_attempts_to_fail=10)
attempt_num = 0
n = length(data)

Expand Down Expand Up @@ -210,15 +210,15 @@ try
end
end

@testset "Fail all 4 attempts then throw" begin
@testset "Fail all 10 attempts then throw" begin
err_t = if AWS.DEFAULT_BACKEND[] isa AWS.HTTPBackend
HTTP.IOError
else
Downloads.RequestError
end
io = IOBuffer()

apply(_incomplete_patch(; data=data, num_attempts_to_fail=4)) do
apply(_incomplete_patch(; data=data, num_attempts_to_fail=10)) do
params = Dict("response_stream" => io)
@test_throws err_t S3.get_object(bucket, key, params; aws_config=config)

Expand Down

0 comments on commit e0210cd

Please sign in to comment.