-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Small bug fixes for core. #28047
Small bug fixes for core. #28047
Conversation
API change check for API changes are not detected in this pull request for |
sdk/core/azure-core/src/test/java/com/azure/core/http/MockHttpResponse.java
Outdated
Show resolved
Hide resolved
…Response.java Co-authored-by: Alan Zimmer <[email protected]>
Hi @pallavit. Thank you for your interest in helping to improve the Azure SDK experience and for your contribution. We've noticed that there hasn't been recent engagement on this pull request. If this is still an active work stream, please let us know by pushing some changes or leaving a comment. Otherwise, we'll close this out in 7 days. |
@alzimmermsft want to merge this PR? |
// Both Netty and OkHttp expect the requestBody to be closed after the response has been read. | ||
// Failure to do so results in memory leak. | ||
// In case of StreamResponse (or other scenarios where we do not eagerly read the response) | ||
// the response body may not be consumed. | ||
// This can cause potential leaks in the scenarios like above, where the policy | ||
// may intercept the response and it may never be read. | ||
// Forcing the read here - so that the memory can be released. | ||
return httpResponse.getBody().ignoreElements() | ||
.then(nextPolicy.process()); |
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.
fwiw we should start using HttpResponse.close
for this.
Small bug fixes for core
Description