Remove Void Responses from being Eagerly Read - #31865
Merged
alzimmermsft merged 4 commits intoNov 1, 2022
Merged
Conversation
mssfang
approved these changes
Nov 1, 2022
Collaborator
|
API change check API changes are not detected in this pull request. |
alzimmermsft
marked this pull request as ready for review
November 1, 2022 16:26
alzimmermsft
requested review from
JonathanGiles,
anuchandy,
billwert,
lmolkova,
srnagar and
vcolin7
as code owners
November 1, 2022 16:26
srnagar
approved these changes
Nov 1, 2022
ibrahimrabab
approved these changes
Nov 1, 2022
alzimmermsft
enabled auto-merge (squash)
November 1, 2022 20:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #28033
Fixes #31555
Fixes #31849
Adds a new concept to
SwaggerMethodParserwhich determines if the network response body will be consumed. This helps resolve an issue where beforevoid-based responses would eagerly be read and could result in error cases. The StoragegetPropertiesAPIs are an example of this where the size of the blob or file is returned by theContent-Lengthheader, then a buffer of that size would be created in preparation to read the response into memory eagerly. This would result in either excessive memory usage orOutOfMemoryErrors, depending on the size of the blob or file. Nowvoid-based responses have special handling where the network response will be ignored and drained instead of attempting to read them.This issue only began happening recently due to multiple, unrelated changes exposing this edge case.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines