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

Specify ContentLength for part uploads #6131

Merged
merged 3 commits into from
Jun 14, 2024
Merged

Specify ContentLength for part uploads #6131

merged 3 commits into from
Jun 14, 2024

Conversation

f8k8
Copy link
Contributor

@f8k8 f8k8 commented May 23, 2024

Issue

#4767

Description

The UploadPartCommand is passed the original parameters, which may include ContentLength. If the ContentLength is included in the original parameters, and the upload is larger than a single chunk, UploadPartCommand has an incorrect value for ContentLength. This change passes the actual size of the chunk as ContentLength, or makes sure it is undefined if the part size is not calculated.

Testing

After upgrading from SDK v2 to v3, our uploads were hanging and eventually timing out. Making this change in our local copy of the SDK fixed the uploads.

Additional context

Checklist

  • If you wrote E2E tests, are they resilient to concurrent I/O?
  • If adding new public functions, did you add the @public tag and enable doc generation on the package?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@f8k8 f8k8 requested a review from a team as a code owner May 23, 2024 19:04
@@ -276,6 +276,7 @@ export class Upload extends EventEmitter {
const partResult = await this.client.send(
new UploadPartCommand({
...this.params,
ContentLength: partSize || undefined,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason not to always set this to undefined?

the body, dataPart.data might always be a buffered value with known length

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured that if the information was there, it might as well be passed. Without knowing the details of how S3 uses that information I don't know if it would be helpful to include it or not, but I don't think there's a down side to including it.

@kuhe kuhe self-assigned this May 24, 2024
@kuhe kuhe added the queued This issues is on the AWS team's backlog label May 24, 2024
@kuhe kuhe merged commit fbfce55 into aws:main Jun 14, 2024
2 of 3 checks passed
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
queued This issues is on the AWS team's backlog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants