Skip to content

Avoid throwing NPE in the CombinedResponseAsyncHttpResponseHandler#onStream #3045

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 4 commits into from
Feb 22, 2022

Conversation

zoewangg
Copy link
Contributor

@zoewangg zoewangg commented Feb 19, 2022

Motivation and Context

This PR intends to expose more information for troubleshooting the following NPE.

| Caused by: java.lang.NullPointerException |
| at software.amazon.awssdk.core.internal.http.async.CombinedResponseAsyncHttpResponseHandler.onStream(CombinedResponseAsyncHttpResponseHandler.java:76) |
| at software.amazon.awssdk.core.internal.http.async.AsyncAfterTransmissionInterceptorCallingResponseHandler.onStream(AsyncAfterTransmissionInterceptorCallingResponseHandler.java:86) |

Modifications

  • Avoid throwing NPE in the CombinedResponseAsyncHttpResponseHandler#onStream
  • Remove unnecessary ActomicReference of SdkHttpFullResponse

Testing

Added unit tests.
Running our test suites now

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

@zoewangg zoewangg changed the title Add null check in the CombinedResponseAsyncHttpResponseHandler Avoid throwing NPE in the CombinedResponseAsyncHttpResponseHandler#onStream Feb 19, 2022
@zoewangg zoewangg marked this pull request as ready for review February 22, 2022 01:34
@zoewangg zoewangg requested a review from a team as a code owner February 22, 2022 01:34
@zoewangg zoewangg enabled auto-merge (squash) February 22, 2022 22:09
@zoewangg zoewangg merged commit 46b6460 into master Feb 22, 2022
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

93.8% 93.8% Coverage
0.0% 0.0% Duplication

@zoewangg zoewangg deleted the zoewang/NPE2 branch March 21, 2022 21:28
aws-sdk-java-automation added a commit that referenced this pull request May 23, 2024
…dfb784332

Pull request: release <- staging/2ad7c850-9d34-49cd-bf7d-73cdfb784332
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