-
Notifications
You must be signed in to change notification settings - Fork 2.1k
service/s3/s3manager: Fix uploader to check for empty part before max parts check #2556
service/s3/s3manager: Fix uploader to check for empty part before max parts check #2556
Conversation
|
reference to an issue will be added shortly |
|
Thanks for taking the time to create this PR @michaelf-stratoscale. The logic makes sense and looks to fix the issue with the max parts corresponds with the reader's EOF exactly. I agree this is a bug that needs to be fixed. I think there are two potentially negative behavior that could result:
Both of these situations require the user to be using |
Clarified S3 Upload Manager's MaxUploadPart parameter that it must not be used to limit the total number of bytes uploaded. An io.LimitReader should be used instead.
jasdel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made a minor update clarifying the role of MaxUploadParts, and how it must not be used as a tool to limit the total size of the object uploaded.
|
Hey @jasdel in the example that i wrote in the issue #2557 i set In any case the code looks good. Do you know when it's going to be pushed? |
|
Hi @michaelf-stratoscale i pushed a small change to this PR that adds unit tests. I'll merge the change in once the Travis tests pass. |
… parts check (aws#2556) Fixes the S3 Upload manager's behavior for uploading exactly MaxUploadParts * PartSize to S3. The uploader would previously return an error after the full content was uploaded, because the assert on max upload parts was occurring before the check if there were any more parts to upload. This change fixes that logic so that the uploader first checks if there are any more chunks to upload before checking if the max number of parts to upload have been reached. Also clarifies the uploader's behavior of MaxUploadParts, and that it must not be used to limit the uploader's total upload size. an io.LimitReader can be used for that purpose. Fix aws#2557
…multiparts