Skip to content

Remove Void Responses from being Eagerly Read - #31865

Merged
alzimmermsft merged 4 commits into
Azure:mainfrom
alzimmermsft:AzCore_FixOomeOnVoidResponses
Nov 1, 2022
Merged

Remove Void Responses from being Eagerly Read#31865
alzimmermsft merged 4 commits into
Azure:mainfrom
alzimmermsft:AzCore_FixOomeOnVoidResponses

Conversation

@alzimmermsft

@alzimmermsft alzimmermsft commented Nov 1, 2022

Copy link
Copy Markdown
Member

Description

Fixes #28033
Fixes #31555
Fixes #31849

Adds a new concept to SwaggerMethodParser which determines if the network response body will be consumed. This helps resolve an issue where before void-based responses would eagerly be read and could result in error cases. The Storage getProperties APIs are an example of this where the size of the blob or file is returned by the Content-Length header, 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 or OutOfMemoryErrors, depending on the size of the blob or file. Now void-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:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@azure-sdk

Copy link
Copy Markdown
Collaborator

API change check

API changes are not detected in this pull request.

@alzimmermsft
alzimmermsft marked this pull request as ready for review November 1, 2022 16:26
@alzimmermsft
alzimmermsft enabled auto-merge (squash) November 1, 2022 20:49
@alzimmermsft
alzimmermsft merged commit fd63df6 into Azure:main Nov 1, 2022
@alzimmermsft
alzimmermsft deleted the AzCore_FixOomeOnVoidResponses branch November 11, 2022 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

5 participants