Adding missed s3 retry handling in storage connector. (#14086)

This commit is contained in:
Karan Kumar 2023-04-14 17:21:39 +05:30 committed by GitHub
parent e3c160f2f2
commit bdc5477094
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 3 deletions

View File

@ -126,9 +126,15 @@ public class RetryableS3OutputStream extends OutputStream
this.s3 = s3;
this.s3Key = s3Key;
final InitiateMultipartUploadResult result = s3.initiateMultipartUpload(
new InitiateMultipartUploadRequest(config.getBucket(), s3Key)
);
final InitiateMultipartUploadResult result;
try {
result = S3Utils.retryS3Operation(() -> s3.initiateMultipartUpload(
new InitiateMultipartUploadRequest(config.getBucket(), s3Key)
), config.getMaxRetry());
}
catch (Exception e) {
throw new IOException("Unable to start multipart upload", e);
}
this.uploadId = result.getUploadId();
this.chunkStorePath = new File(config.getTempDir(), uploadId + UUID.randomUUID());
FileUtils.mkdirp(this.chunkStorePath);