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

Wait until response body or error body received to process request #4786

Merged
merged 2 commits into from
Dec 21, 2023

Conversation

dagnir
Copy link
Contributor

@dagnir dagnir commented Dec 15, 2023

Motivation and Context

This fixes issue reported in #4684. Basically, in situations where the identity used to call s3.getObject() has permissions to successfully perform a HeadObject but not a GetObject (i.e. this results in an error response), the S3 client thinks the the call was actually successful (because HeadObject was successful) and returns the error response content as the object content.

Modifications

  • Don't rely on onResponseHeaders because these are not indicative if whether the request succeeded. Move calls to responseHandler.onHeanders() to onResponseBody and onFinished

Testing

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license

@dagnir dagnir force-pushed the dongie/s3-crt-response-handling branch 3 times, most recently from c930453 to 861440e Compare December 19, 2023 22:37
@dagnir dagnir marked this pull request as ready for review December 19, 2023 22:48
@dagnir dagnir requested a review from a team as a code owner December 19, 2023 22:48
@zoewangg
Copy link
Contributor

Can we also add motivation for this change and change log entry?

@dagnir dagnir force-pushed the dongie/s3-crt-response-handling branch from 861440e to 614c1ad Compare December 21, 2023 00:25
@dagnir dagnir force-pushed the dongie/s3-crt-response-handling branch from 614c1ad to 35598f9 Compare December 21, 2023 00:30
@dagnir
Copy link
Contributor Author

dagnir commented Dec 21, 2023

Can we also add motivation for this change and change log entry?

Done

@dagnir dagnir enabled auto-merge (squash) December 21, 2023 00:38
@dagnir dagnir merged commit 0980e94 into master Dec 21, 2023
13 checks passed
Copy link

sonarcloud bot commented Dec 21, 2023

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

3 New issues
0 Security Hotspots
100.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

aws-sdk-java-automation pushed a commit that referenced this pull request Dec 21, 2023
dagnir added a commit that referenced this pull request Dec 21, 2023
dagnir added a commit that referenced this pull request Dec 21, 2023
dagnir added a commit that referenced this pull request Dec 22, 2023
* Fix ChecksumIntegrationTest

- Some tests specificy a part number, but CRT may do a range get under the hood.
  S3 will throw an error if both a range and part number are specified. This is
an issue that needs to be fixed in CRT, but part number is not required in this
test, so removing it.

 - Rename test file to CrtCheckIntegrationTest so it gets added to CRT test
   suite

* Revert "Revert "Wait until response body or error body received to process request (#4786)""

This reverts commit 045bcc4.
zoewangg added a commit that referenced this pull request Jan 5, 2024
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.

2 participants