Skip to content

Commit 2d76d8f

Browse files
authored
Fix silent failure when downloading a directory with AWS SDK v2 (#6266) [ci fast]
Signed-off-by: jorgee <jorge.ejarque@seqera.io>
1 parent b8ccddb commit 2d76d8f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

plugins/nf-amazon/src/main/nextflow/cloud/aws/nio/S3Client.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,11 @@ public void downloadDirectory(S3Path source, File targetFile) throws IOException
506506

507507
DirectoryDownload downloadDirectory = transferManager().downloadDirectory(downloadDirRequest);
508508
try{
509-
downloadDirectory.completionFuture().get();
509+
CompletedDirectoryDownload completed = downloadDirectory.completionFuture().get();
510+
if (!completed.failedTransfers().isEmpty()){
511+
log.debug("S3 download directory: s3://{}/{} failed transfers", source.getBucket(), source.getKey());
512+
throw new IOException("Some transfers in S3 download directory: s3://"+ source.getBucket() +"/"+ source.getKey() +" has failed - Transfers: " + completed.failedTransfers() );
513+
}
510514
} catch (InterruptedException e){
511515
log.debug("S3 download directory: s3://{}/{} interrupted", source.getBucket(), source.getKey());
512516
Thread.currentThread().interrupt();

0 commit comments

Comments
 (0)