Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InMemoryBufferingS3OutputStream wrongly applys contentLength to UploadPartRequest causing timeout #1248

Closed
Mobe91 opened this issue Oct 1, 2024 · 1 comment · Fixed by #1249
Labels
component: s3 S3 integration related issue type: bug Something isn't working
Milestone

Comments

@Mobe91
Copy link
Contributor

Mobe91 commented Oct 1, 2024

Large file uploads that are broken up into multiple part uploads by InMemoryBufferingS3OutputStream result in a request timeout if ObjectMetadata containing the full content length of the file is supplied. This is because InMemoryBufferingS3OutputStream applies the full ObjectMetadata including the content length to the software.amazon.awssdk.services.s3.model.UploadPartRequest.

Example code snippet that causes the issue:

byte[] content = new byte[20_000_000];
InputStream is = new ByteArrayInputStream(content);
s3Template.upload(bucketName, storageKey, is, ObjectMetadata.builder().contentLength(content.length).build());
@maciejwalkowiak maciejwalkowiak added type: bug Something isn't working component: s3 S3 integration related issue labels Oct 1, 2024
@maciejwalkowiak
Copy link
Contributor

Thanks for reporting @Mobe91. Would you like to contribute a fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: s3 S3 integration related issue type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants