Skip to content

Commit d02b653

Browse files
authored
S3BlobContainer: Revert broadened exception handler (#126731)
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 2a24918 commit d02b653

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
@@ -402,9 +402,6 @@ tests:
402402
- class: org.elasticsearch.xpack.esql.action.EsqlActionIT
403403
method: testQueryOnEmptyDataIndex
404404
issue: https://github.com/elastic/elasticsearch/issues/126580
405-
- class: org.elasticsearch.repositories.blobstore.testkit.analyze.S3RepositoryAnalysisRestIT
406-
method: testRepositoryAnalysis
407-
issue: https://github.com/elastic/elasticsearch/issues/126576
408405
- class: org.elasticsearch.xpack.ilm.TimeSeriesDataStreamsIT
409406
method: testShrinkActionInPolicyWithoutHotPhase
410407
issue: https://github.com/elastic/elasticsearch/issues/126746

0 commit comments

Comments
 (0)