Skip to content
This repository was archived by the owner on Oct 15, 2021. It is now read-only.

Implement AOS-62 WriteMultipart returns Part #88

Merged
merged 4 commits into from
May 14, 2021
Merged

Implement AOS-62 WriteMultipart returns Part #88

merged 4 commits into from
May 14, 2021

Conversation

JinnyYi
Copy link
Contributor

@JinnyYi JinnyYi commented May 13, 2021

storage.go Outdated
Key: aws.String(o.ID),
UploadId: aws.String(o.MustGetMultipartID()),
ContentLength: &size,
Body: iowrap.SizedReadSeekCloser(r, size),
Body: aws.ReadSeekCloser(r),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why we need to migrate from iowrap.SizedReadSeekCloser to aws.ReadSeekCloser?

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 don't know why WirteMultipart got the RequestError in the last commit. I found that aws.ReadSeekCloser is used in write, so I migrated to aws.ReadSeekCloser to have a try. The error info is:

RequestError: send request failed
...
net/http: HTTP/1.x transport connection broken: http: ContentLength=1543539 with Body length 0'

Copy link
Collaborator

@Xuanwo Xuanwo May 13, 2021

Choose a reason for hiding this comment

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

Please figure out why.

If there is a bug in iowrap, please fix it. Don't solve problem by skip it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator

@Xuanwo Xuanwo May 13, 2021

Choose a reason for hiding this comment

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

S3 SDK will compute Content MD5 by default which will consume our input reader. However, our input reader is a bytes.Reader which can only be consumed once.

In go-storage, we will let users to calculate content md5 and passed into as a pair Content-MD5.

So we need to set S3DisableContentMD5Validation to true to disable the auto content md5 check.

cfg.S3DisableContentMD5Validation = aws.Bool(true)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please change it back, we will use our own iowrap instead of the one provided by SDK.

@Xuanwo Xuanwo merged commit a618986 into master May 14, 2021
@Xuanwo Xuanwo deleted the multiparter branch May 14, 2021 03:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants