Skip to content

Commit 78b4fb6

Browse files
committed
S3BlobContainer: Revert broadened exception handler again
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 elastic#126731, regressed due to elastic#126843 Closes elastic#127399
1 parent 79e9dfd commit 78b4fb6

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
@@ -447,9 +447,6 @@ tests:
447447
- class: org.elasticsearch.xpack.esql.heap_attack.HeapAttackIT
448448
method: testLookupExplosionNoFetch
449449
issue: https://github.com/elastic/elasticsearch/issues/127365
450-
- class: org.elasticsearch.repositories.blobstore.testkit.analyze.S3RepositoryAnalysisRestIT
451-
method: testRepositoryAnalysis
452-
issue: https://github.com/elastic/elasticsearch/issues/127399
453450

454451
# Examples:
455452
#

0 commit comments

Comments
 (0)