Skip to content

Abort multi part download if the object is modified during download #3248

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

Merged
merged 7 commits into from
May 14, 2025

Conversation

richardwang1124
Copy link
Contributor

@richardwang1124 richardwang1124 commented May 13, 2025

Adds an etag if match statement to the get by parts/ranges functionality during multipart download of the transfer manager. In the event a file is changed mid operation, multipart download will abort and no file will be downloaded.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

  1. To make sure we include your contribution in the release notes, please make sure to add description entry for your changes in the "unreleased changes" section of the CHANGELOG.md file (at corresponding gem). For the description entry, please make sure it lives in one line and starts with Feature or Issue in the correct format.

  2. For generated code changes, please checkout below instructions first:
    https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md

Thank you for your contribution!

Copy link
Contributor

@jterapin jterapin left a comment

Choose a reason for hiding this comment

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

LGTM

@richardwang1124 richardwang1124 changed the title Add if_match to multi part download Abort multi part download if the object is modified during download May 14, 2025
@@ -221,6 +221,58 @@ module S3
end.to raise_error(Aws::Errors::ChecksumError)
end

it 'does not download object when ETAG does not match during multipart get by ranges' do
allow(client).to receive(:head_object).with({
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess this is fine seeing as other tests in this file are doing it.. but the tests here should be refactored (transfer manager makes these kind of obsolete anyway).

Copy link

Detected 1 possible performance regressions:

  • aws-sdk-cloudwatchlogs.put_log_events_large_allocated_kb - z-score regression: 5992.44 -> 5992.58. Z-score: 18.88

@richardwang1124 richardwang1124 merged commit 68fd8f6 into version-3 May 14, 2025
33 checks passed
@richardwang1124 richardwang1124 deleted the fix/transfer-manager-etag branch May 14, 2025 21:17
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