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

Fix S3 streaming download corruption #1087

Merged
merged 2 commits into from
Jan 12, 2015
Merged

Conversation

jamesls
Copy link
Member

@jamesls jamesls commented Jan 12, 2015

When a download is being piped to stdout aws s3 cp s3://foo/ -, it's possible that data can be written out twice. The issue is that the response body is read in chunks smaller than the range get size. When a retry occurs the whole request (for the entire range) is retried. If this retry occurs at the Nth chunk, the chunks 1-N will be enqueued again.

The fix for now is to just enqueue writes at the same size as the chunk size. I think longer term, there are definitely some optimizations we can do to improve this, but that shouldn't block getting a fix in now.

cc @kyleknap

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) when pulling ed9000b on jamesls:fix-s3-stream-retry into 6afb7c5 on aws:develop.

@jamesls
Copy link
Member Author

jamesls commented Jan 12, 2015

Actually, hold up on the review. I'm seeing some issues that still need to be fixed.

@jamesls
Copy link
Member Author

jamesls commented Jan 12, 2015

PR has been updated, @kyleknap feel free to review now.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) when pulling 9dabc65 on jamesls:fix-s3-stream-retry into 6afb7c5 on aws:develop.

@kyleknap
Copy link
Contributor

Agreed. Looks good. 🚢

@jamesls jamesls merged commit 9dabc65 into aws:develop Jan 12, 2015
thoward-godaddy pushed a commit to thoward-godaddy/aws-cli that referenced this pull request Feb 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants