Skip to content

Commit

Permalink
Add hint based on response code
Browse files Browse the repository at this point in the history
  • Loading branch information
yma11 committed May 8, 2024
1 parent 6f156cb commit ce52cbf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions velox/connectors/hive/storage_adapters/s3fs/S3FileSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ class S3FileSystem::Impl {
if (maxAttempts.has_value()) {
VELOX_USER_CHECK(
(maxAttempts.value() > 0),
"Invalid configuration: specify 'max-attempts' > 0.");
"Invalid configuration: specify 'hive.s3.max-attempts' > 0.");
return std::make_shared<Aws::Client::StandardRetryStrategy>(
maxAttempts.value());
} else {
Expand All @@ -667,7 +667,7 @@ class S3FileSystem::Impl {
if (maxAttempts.has_value()) {
VELOX_USER_CHECK(
(maxAttempts.value() > 0),
"Invalid configuration: specify 'max-attempts' > 0.");
"Invalid configuration: specify 'hive.s3.max-attempts' > 0.");
return std::make_shared<Aws::Client::AdaptiveRetryStrategy>(
maxAttempts.value());
} else {
Expand All @@ -678,7 +678,7 @@ class S3FileSystem::Impl {
if (maxAttempts.has_value()) {
VELOX_USER_CHECK(
(maxAttempts.value() > 0),
"Invalid configuration: specify 'max-attempts' > 0.");
"Invalid configuration: specify 'hive.s3.max-attempts' > 0.");
return std::make_shared<Aws::Client::DefaultRetryStrategy>(
maxAttempts.value());
} else {
Expand Down
3 changes: 3 additions & 0 deletions velox/connectors/hive/storage_adapters/s3fs/S3Util.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ inline std::string getRequestID(
getS3BackendService(error.GetResponseHeaders()), \
error.GetMessage(), \
getRequestID(error.GetResponseHeaders())); \
if (IsRetryableHttpResponseCode(error.GetResponseCode())) { \
errMsg.append("You may can try properly setting 'hive.s3.retry-mode' and increasing 'hive.s3.max-attempts'."); \
} \
if (error.GetResponseCode() == Aws::Http::HttpResponseCode::NOT_FOUND) { \
VELOX_FILE_NOT_FOUND_ERROR(errMsg); \
} \
Expand Down

0 comments on commit ce52cbf

Please sign in to comment.