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

service/s3/s3manager: Downloader ignores byte range #1296

Closed
sandoracs opened this issue May 24, 2017 · 6 comments
Closed

service/s3/s3manager: Downloader ignores byte range #1296

sandoracs opened this issue May 24, 2017 · 6 comments
Labels
bug This issue is a bug. investigating This issue is being investigated and/or work is in progress to resolve the issue.

Comments

@sandoracs
Copy link

Please fill out the sections below to help us address your issue.

Version of AWS SDK for Go?

v1.8.12-6-gbaba9e7

Version of Go (go version)?

go version go1.8 darwin/amd64

What issue did you see?

Byte range is ignored by 'downloader.Download()'

Steps to reproduce

`downloader := s3manager.NewDownloader(sess)
f, _ := os.Create("/tmp/data")
defer f.Close()

size, _ = downloader.Download(f, &s3.GetObjectInput{
Bucket: aws.String("bucket"),
Key: aws.String("key"),
Range: aws.String("bytes=0-8191"),
})`

It will download the full object instead of the first 8MB.

@jasdel
Copy link
Contributor

jasdel commented May 24, 2017

Thanks for creating this issue @sandoracs. I agree this looks to be an oversight with S3 Download Manager. I think it makes sense for the downloader to use this value.

Since the value was being ignored before we'd need to figure out how the SDK should handle this field if it is not formatted properly.

@jasdel jasdel added the bug This issue is a bug. label May 24, 2017
@jasdel
Copy link
Contributor

jasdel commented May 25, 2017

In the meantime @sandoracs the S3.GetObject API call will work correctly with the Range parameter. This could be used as a workaround until the SDK's download manager issue is fixed.

@sandoracs
Copy link
Author

Thank you!

@jasdel
Copy link
Contributor

jasdel commented May 31, 2017

In taking a look at this issue, it looks to support this feature the S3 Download Manager would need a pretty significant refactor. To address the issue of taking a slice of an Object I think the downloader can be updated to short circuit multipart download functionality and fallback to using GetObject directly.

We can then see if there is demand for full byte-range support within the download manager and prioritize that as a feature request.

jasdel added a commit to jasdel/aws-sdk-go that referenced this issue May 31, 2017
Fixes the S3 Download Manager ignoring the GetObjectInput's Range
parameter. If this parameter is provided it will force the downloader to
fallback to a single GetObject request disabling concurrency and
automatic part size gets.

This can be improved, if there is demand, for the feature to parse the
byte range value provided and bulding range gets with it.

Fix aws#1296
@jasdel jasdel changed the title s3manager downloader ignores byte range service/s3/s3manager: Downloader ignores byte range May 31, 2017
@jasdel jasdel added the investigating This issue is being investigated and/or work is in progress to resolve the issue. label May 31, 2017
jasdel added a commit to jasdel/aws-sdk-go that referenced this issue Jun 1, 2017
Fixes the S3 Download Manager ignoring the GetObjectInput's Range
parameter. If this parameter is provided it will force the downloader to
fallback to a single GetObject request disabling concurrency and
automatic part size gets.

This can be improved, if there is demand, for the feature to parse the
byte range value provided and bulding range gets with it.

Fix aws#1296
jasdel added a commit to jasdel/aws-sdk-go that referenced this issue Jun 1, 2017
Fixes the S3 Download Manager ignoring the GetObjectInput's Range
parameter. If this parameter is provided it will force the downloader to
fallback to a single GetObject request disabling concurrency and
automatic part size gets.

This can be improved, if there is demand, for the feature to parse the
byte range value provided and bulding range gets with it.

Fix aws#1296
jasdel added a commit that referenced this issue Jun 1, 2017
)

Fixes the S3 Download Manager ignoring the GetObjectInput's Range
parameter. If this parameter is provided it will force the downloader to
fallback to a single GetObject request disabling concurrency and
automatic part size gets.

Fix #1296
@jasdel
Copy link
Contributor

jasdel commented Jun 1, 2017

Hi @sandoracs I've just merged in #1311 . This basic support for Byte-Range with the S3 manager. Setting this field will disable S3's concurrency support. We can take a look at adding further support for byte range with multipart get object download as a feature request.

@sandoracs
Copy link
Author

Hi! Thank you very much! 👍

@awstools awstools mentioned this issue Jun 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. investigating This issue is being investigated and/or work is in progress to resolve the issue.
Projects
None yet
Development

No branches or pull requests

2 participants