From 8d6215f6997defbfbdca0a9aca2b16701553b148 Mon Sep 17 00:00:00 2001 From: Guihao Liang Date: Sun, 12 Apr 2020 22:23:00 -0700 Subject: [PATCH] get the retry logic back (#3114) --- src/core/storage/fileio/s3_api.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/core/storage/fileio/s3_api.cpp b/src/core/storage/fileio/s3_api.cpp index b8f1271c05..bd33ac8a3b 100644 --- a/src/core/storage/fileio/s3_api.cpp +++ b/src/core/storage/fileio/s3_api.cpp @@ -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()) { @@ -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) {