Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
4.4.0, 4.7.0
-
None
-
Novice
Description
The Camel component camel-aws2-s3 has a producer boolean option called multiPartUpload.
Based on the documentation, when this attribute is set to true, the upload will be with multipart format in case the file is larger than the partSize (another attribute).
This is not happening, when multiPartUpload is set to true, the upload is always in multipart format unless the fileSize is 0, which is a corner case.
The root cause of the problem is in the AWS2S3Producer code around line 151.
long partSize = getConfiguration().getPartSize();
if (contentLength == 0 && contentLength < partSize) {
// optimize to do a single op if content length is known and < part size
LOG.debug("File size < partSize. Uploading file in single operation: {}", filePayload);
processSingleOp(exchange);
return;
}
If the contentLength is not 0, the condition "contentLength < partSize" is never met so the upload is always done as multipart.
This is really affecting performance upload when files are below the partSize.
The proposed fix is just to change the condition to:
if (contentLength == 0 || contentLength < partSize) {
...
Attachments
Attachments
Issue Links
- is caused by
-
CAMEL-19707 camel-aws2-s3 multipart uploads crash with zero-byte files
- Resolved
- links to