Skip to content

Commit 5c753a8

Browse files
authored
S3BlobContainer: Revert broadened exception handler again (#127405)
Catching `Exception` instead of `SdkException` in `copyBlob` and `executeMultipart` led to failures in `S3RepositoryAnalysisRestIT` due to the injected exceptions getting wrapped in `IOExceptions` that prevented them from being caught and handled in `BlobAnalyzeAction`. Repeat of #126731, regressed due to #126843 Closes #127399
1 parent 6975c88 commit 5c753a8

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

modules/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3BlobContainer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ public void copyBlob(
394394
SocketAccess.doPrivilegedVoid(() -> clientReference.client().copyObject(copyObjectRequest));
395395
}
396396
}
397-
} catch (final Exception e) {
397+
} catch (final SdkException e) {
398398
if (e instanceof SdkServiceException sse && sse.statusCode() == RestStatus.NOT_FOUND.getStatus()) {
399399
throw new NoSuchFileException(
400400
"Copy source [" + s3SourceBlobContainer.buildKey(sourceBlobName) + "] not found: " + sse.getMessage()
@@ -660,7 +660,7 @@ private void executeMultipart(
660660
SocketAccess.doPrivilegedVoid(() -> clientReference.client().completeMultipartUpload(completeMultipartUploadRequest));
661661
}
662662
cleanupOnFailureActions.clear();
663-
} catch (final Exception e) {
663+
} catch (final SdkException e) {
664664
if (e instanceof SdkServiceException sse && sse.statusCode() == RestStatus.NOT_FOUND.getStatus()) {
665665
throw new NoSuchFileException(blobName, null, e.getMessage());
666666
}

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,9 +441,6 @@ tests:
441441
- class: org.elasticsearch.xpack.esql.heap_attack.HeapAttackIT
442442
method: testLookupExplosionNoFetch
443443
issue: https://github.com/elastic/elasticsearch/issues/127365
444-
- class: org.elasticsearch.repositories.blobstore.testkit.analyze.S3RepositoryAnalysisRestIT
445-
method: testRepositoryAnalysis
446-
issue: https://github.com/elastic/elasticsearch/issues/127399
447444

448445
# Examples:
449446
#

0 commit comments

Comments
 (0)