Skip to content

Commit 6bd1eb7

Browse files
committed
S3BlobContainer: Revert broadened exception handler
Catching Exception instead of AmazonClientException 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. Closes #126576
1 parent 4cbc5eb commit 6bd1eb7

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
@@ -377,7 +377,7 @@ public void copyBlob(
377377
SocketAccess.doPrivilegedVoid(() -> { clientReference.client().copyObject(copyRequest); });
378378
}
379379
}
380-
} catch (final Exception e) {
380+
} catch (final AmazonClientException e) {
381381
if (e instanceof AmazonServiceException ase && ase.getStatusCode() == RestStatus.NOT_FOUND.getStatus()) {
382382
throw new NoSuchFileException(
383383
"Copy source [" + s3SourceBlobContainer.buildKey(sourceBlobName) + "] not found: " + ase.getMessage()
@@ -618,7 +618,7 @@ private void executeMultipart(
618618
SocketAccess.doPrivilegedVoid(() -> clientReference.client().completeMultipartUpload(complRequest));
619619
}
620620
success = true;
621-
} catch (final Exception e) {
621+
} catch (final AmazonClientException e) {
622622
if (e instanceof AmazonServiceException ase && ase.getStatusCode() == RestStatus.NOT_FOUND.getStatus()) {
623623
throw new NoSuchFileException(blobName, null, e.getMessage());
624624
}

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,6 @@ tests:
405405
- class: org.elasticsearch.xpack.esql.action.EsqlActionIT
406406
method: testQueryOnEmptyDataIndex
407407
issue: https://github.com/elastic/elasticsearch/issues/126580
408-
- class: org.elasticsearch.repositories.blobstore.testkit.analyze.S3RepositoryAnalysisRestIT
409-
method: testRepositoryAnalysis
410-
issue: https://github.com/elastic/elasticsearch/issues/126576
411408

412409
# Examples:
413410
#

0 commit comments

Comments
 (0)