Skip to content

Commit

Permalink
retry on 503 error
Browse files Browse the repository at this point in the history
503 return code means service temporarily not available.
  • Loading branch information
FelixYBW authored and yma11 committed May 6, 2024
1 parent 97f947e commit 620967f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion velox/connectors/hive/storage_adapters/s3fs/S3FileSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,12 @@ class S3ReadFile final : public ReadFile {
request.SetBucket(awsString(bucket_));
request.SetKey(awsString(key_));

auto outcome = client_->HeadObject(request);

Aws::S3::Model::HeadObjectOutcome outcome;
do{
outcome = client_->HeadObject(request);
}while(!outcome.IsSuccess() && outcome.GetError().GetResponseCode() == 503);

VELOX_CHECK_AWS_OUTCOME(
outcome, "Failed to get metadata for S3 object", bucket_, key_);
length_ = outcome.GetResult().GetContentLength();
Expand Down

0 comments on commit 620967f

Please sign in to comment.