-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
S3 operations CopyObject, UploadPartCopy and CompleteMultipartUpload don't close http.Response.Body #4037
Labels
bug
This issue is a bug.
Comments
ashtuchkin
added
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
labels
Jul 30, 2021
ashtuchkin
changed the title
S3 operations CopyObject, UploadPartCopy and CompleteMultipartUpload don't close HTTPResponse Body.
S3 operations CopyObject, UploadPartCopy and CompleteMultipartUpload don't close http.Response.Body
Jul 30, 2021
Hi @ashtuchkin , |
Sounds good.
…On Tue, Aug 3, 2021 at 1:25 PM Gilberto Lopez Zayas < ***@***.***> wrote:
Hi @ashtuchkin <https://github.com/ashtuchkin> ,
Yea, it would definitely help us, please provide one.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4037 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEZKHNCEZBTHN6S5H6DUFTT3AQ6ZANCNFSM5BJGYAXA>
.
|
ashtuchkin
added a commit
to ashtuchkin/aws-sdk-go
that referenced
this issue
Aug 4, 2021
…nd CompleteMultipartUpload operations. Fixes aws#4037
Please see PR #4045 |
jasdel
pushed a commit
to ashtuchkin/aws-sdk-go
that referenced
this issue
Aug 17, 2021
…nd CompleteMultipartUpload operations. Fixes aws#4037
|
aws-sdk-go-automation
pushed a commit
that referenced
this issue
Aug 18, 2021
=== ### Service Client Updates * `service/codebuild`: Updates service API and documentation * CodeBuild now allows you to make the build results for your build projects available to the public without requiring access to an AWS account. * `service/route53`: Updates service documentation * Documentation updates for route53 * `service/route53resolver`: Updates service documentation * `service/runtime.sagemaker`: Updates service API and documentation * `service/sagemaker`: Updates service API and documentation * Amazon SageMaker now supports Asynchronous Inference endpoints. Adds PlatformIdentifier field that allows Notebook Instance creation with different platform selections. Increases the maximum number of containers in multi-container endpoints to 15. Adds more instance types to InstanceType field. ### SDK Bugs * `service/s3`: Close http.Response.Body in CopyObject, UploadPartCopy and CompleteMultipartUpload operations * Fixes [#4037](#4037)
Merged
aws-sdk-go-automation
added a commit
that referenced
this issue
Aug 18, 2021
Release v1.40.25 (2021-08-18) === ### Service Client Updates * `service/codebuild`: Updates service API and documentation * CodeBuild now allows you to make the build results for your build projects available to the public without requiring access to an AWS account. * `service/route53`: Updates service documentation * Documentation updates for route53 * `service/route53resolver`: Updates service documentation * `service/runtime.sagemaker`: Updates service API and documentation * `service/sagemaker`: Updates service API and documentation * Amazon SageMaker now supports Asynchronous Inference endpoints. Adds PlatformIdentifier field that allows Notebook Instance creation with different platform selections. Increases the maximum number of containers in multi-container endpoints to 15. Adds more instance types to InstanceType field. ### SDK Bugs * `service/s3`: Close http.Response.Body in CopyObject, UploadPartCopy and CompleteMultipartUpload operations * Fixes [#4037](#4037)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
S3 operations CopyObject, UploadPartCopy and CompleteMultipartUpload use
copyMultipartStatusOKUnmarhsalError
unmarshal handler added in 34eb9e6 (see https://github.com/aws/aws-sdk-go/blob/v1.40.12/service/s3/customizations.go#L43).This function reads all of
r.HTTPResponse.Body
into a buffer, but it's not closing it (see https://github.com/aws/aws-sdk-go/blob/v1.40.12/service/s3/statusok_error.go#L15). Not closing the response body violates http.Response contract (see docs at https://pkg.go.dev/net/http#Response), leading to inability to reuse network connection for future requests and, in our case, also breaking instrumentation for these particular operations. See https://stackoverflow.com/a/33238755/325300Version of AWS SDK for Go?
v1.40.8
Version of Go (
go version
)?1.16.5
To Reproduce (observed behavior)
I consistently reproduce this in our tests, but it'll take some time to create a minimally reproducible example. Let me know if you actually need it.
Expected behavior
HTTPResponse.Body must be closed after reading here: https://github.com/aws/aws-sdk-go/blob/v1.40.12/service/s3/statusok_error.go#L15.
Additional context
I can do a PR to fix it if you'd like.
The text was updated successfully, but these errors were encountered: