Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
get the retry logic back (#3114)
Browse files Browse the repository at this point in the history
  • Loading branch information
Guihao Liang authored Apr 13, 2020
1 parent 58a8ea4 commit 8d6215f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/core/storage/fileio/s3_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ S3Client init_aws_sdk_with_turi_env(s3url& parsed_url) {
Aws::Client::ClientConfiguration clientConfiguration;

// a little bit too long, anyway
clientConfiguration.requestTimeoutMs = 2 * 60000;
clientConfiguration.requestTimeoutMs = 5 * 60000;
clientConfiguration.connectTimeoutMs = 20000;

if (turi::fileio::insecure_ssl_cert_checks()) {
Expand Down Expand Up @@ -513,8 +513,10 @@ list_objects_response list_objects_impl(s3url parsed_url, std::string proxy,

} else {
auto error = outcome.GetError();

if (error.ShouldRetry()) {
// Unlike CoreErrors, S3Error Never retries. Use Http code instead.
// check aws-cpp-sdk-s3/source/S3Error.cpp
if (error.GetResponseCode() ==
Aws::Http::HttpResponseCode::TOO_MANY_REQUESTS) {
n_retry++;

if (n_retry == 3) {
Expand Down

0 comments on commit 8d6215f

Please sign in to comment.