diff --git a/doc/release-notes/12358-enable-s3-multipart-upload.md b/doc/release-notes/12358-enable-s3-multipart-upload.md new file mode 100644 index 00000000000..22365fbbaec --- /dev/null +++ b/doc/release-notes/12358-enable-s3-multipart-upload.md @@ -0,0 +1 @@ +Fixed a defect that caused upload of files larger than 1G to fail silently for S3 storage, unless direct upload was used. \ No newline at end of file diff --git a/src/main/java/edu/harvard/iq/dataverse/dataaccess/S3AccessIO.java b/src/main/java/edu/harvard/iq/dataverse/dataaccess/S3AccessIO.java index cb5175bd354..6d3fe205639 100644 --- a/src/main/java/edu/harvard/iq/dataverse/dataaccess/S3AccessIO.java +++ b/src/main/java/edu/harvard/iq/dataverse/dataaccess/S3AccessIO.java @@ -1208,6 +1208,9 @@ private static S3AsyncClient getClient(String driverId) { // Create a builder for the S3AsyncClient S3AsyncClientBuilder s3CB = S3AsyncClient.builder().requestChecksumCalculation(RequestChecksumCalculation.WHEN_REQUIRED); + // Always enable multipart upload. It is only used when necessary + s3CB.multipartEnabled(true); + // Create a custom HTTP client with the desired pool size Integer poolSize = Integer.getInteger("dataverse.files." + driverId + ".connection-pool-size", 256); Builder httpClientBuilder = NettyNioAsyncHttpClient.builder().maxConcurrency(poolSize);