-
Notifications
You must be signed in to change notification settings - Fork 936
added part count validation for download request #6353
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
base: master
Are you sure you want to change the base?
Conversation
...ava/software/amazon/awssdk/services/s3/internal/multipart/MultipartDownloaderSubscriber.java
Outdated
Show resolved
Hide resolved
...ava/software/amazon/awssdk/services/s3/internal/multipart/MultipartDownloaderSubscriber.java
Outdated
Show resolved
Hide resolved
...ava/software/amazon/awssdk/services/s3/internal/multipart/MultipartDownloaderSubscriber.java
Outdated
Show resolved
Hide resolved
...ava/software/amazon/awssdk/services/s3/internal/multipart/MultipartDownloaderSubscriber.java
Outdated
Show resolved
Hide resolved
...ava/software/amazon/awssdk/services/s3/internal/multipart/MultipartDownloaderSubscriber.java
Outdated
Show resolved
Hide resolved
...st/java/software/amazon/awssdk/services/s3/internal/multipart/MultipartDownloadTestUtil.java
Outdated
Show resolved
Hide resolved
...ava/software/amazon/awssdk/services/s3/internal/multipart/MultipartDownloaderSubscriber.java
Outdated
Show resolved
Hide resolved
...ava/software/amazon/awssdk/services/s3/internal/multipart/MultipartDownloaderSubscriber.java
Outdated
Show resolved
Hide resolved
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.
Can we add some tests cases for this new validation?
I think we need a test with an actual multipart s3AsyncClient, ie:
We can still mock the http client but that might be a hard test to mock, let me think about it to see if there is a way to do it. |
...ava/software/amazon/awssdk/services/s3/internal/multipart/MultipartDownloaderSubscriber.java
Outdated
Show resolved
Hide resolved
Please retry analysis of this Pull-Request directly on SonarQube Cloud |
@@ -66,6 +66,7 @@ public byte[] stubForPart(String testBucket, String testKey,int part, int totalP | |||
aResponse() | |||
.withHeader("x-amz-mp-parts-count", totalPart + "") | |||
.withHeader("ETag", eTag) | |||
.withHeader("Content-Length", String.valueOf(body.length)) |
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.
Just curious, why are we making this change?
Motivation and Context
For the part get request for S3 transfer manager, When a response is received, the S3 Transfer Manager MUST check the value of ContentRange and validate that it matches with the expected range for the specific part number. After all requests have been sent, we should validate that the total number of part GET requests sent matches with the expected PartsCount. This PR implements the validation.
Modifications
Added validation method in MultipartDownloaderSubscriber class
Testing
Added wiremock test for failed test
Screenshots (if appropriate)
Types of changes
Checklist
mvn install
succeedsscripts/new-change
script and following the instructions. Commit the new file created by the script in.changes/next-release
with your changes.License