From d59ca43bff8a457ce7ab62a61acd89aacbe71b93 Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Tue, 16 Oct 2018 20:02:54 +0100 Subject: [PATCH] HADOOP-15826. @Retries annotation of putObject() call & uses wrong. Contributed by Steve Loughran and Ewan Higgs. --- .../main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java | 5 ++++- .../java/org/apache/hadoop/fs/s3a/WriteOperationHelper.java | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java index df0ec5d462d..3c432fc7c7a 100644 --- a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java +++ b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java @@ -2449,11 +2449,14 @@ public class S3AFileSystem extends FileSystem implements StreamCapabilities { * Wait for an upload to complete. * If the waiting for completion is interrupted, the upload will be * aborted before an {@code InterruptedIOException} is thrown. - * @param upload upload to wait for + * If the upload (or its result collection) failed, this is where + * the failure is raised as an AWS exception * @param key destination key + * @param uploadInfo upload to wait for * @return the upload result * @throws InterruptedIOException if the blocking was interrupted. */ + @Retries.OnceRaw UploadResult waitForUploadCompletion(String key, UploadInfo uploadInfo) throws InterruptedIOException { Upload upload = uploadInfo.getUpload(); diff --git a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/WriteOperationHelper.java b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/WriteOperationHelper.java index a85a87f7f44..a5f68179d96 100644 --- a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/WriteOperationHelper.java +++ b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/WriteOperationHelper.java @@ -436,7 +436,7 @@ public class WriteOperationHelper { * @return the result of the operation * @throws IOException on problems */ - @Retries.OnceTranslated + @Retries.RetryTranslated public UploadResult uploadObject(PutObjectRequest putObjectRequest) throws IOException { // no retry; rely on xfer manager logic @@ -451,7 +451,7 @@ public class WriteOperationHelper { * @throws IOException on problems * @param destKey destination key */ - @Retries.RetryTranslated + @Retries.OnceTranslated public void revertCommit(String destKey) throws IOException { once("revert commit", destKey, () -> {