-
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
panic inside WithGetResponseHeader #4211
Comments
Hi @minaevmike , |
🔆 |
We've run into this issue at our company, the issue here is that the Send method will always execute the Complete handlers, but if the request is canceled before the response object is initialized we get a nil pointer dereference causing a panic. To reproduce, I would initiate the call in one go routine, and cancel the context in a second go routine right after a call to Send. |
Updates SDK Request.Send to always ensure HTTPResponse member is not nil, and its Header and Body fields are not nil as well. Fixes aws#4211
Thanks for reporting this issue, and providing reproduction example. I put together #4256 that fixes this bug and ensures that HTTPResponse will not be nil when Complete handlers are called returns. |
|
=== ### Service Client Updates * `service/amplify`: Updates service documentation * `service/connect`: Updates service API and documentation * `service/ec2`: Updates service API * X2ezn instances are powered by Intel Cascade Lake CPUs that deliver turbo all core frequency of up to 4.5 GHz and up to 100 Gbps of networking bandwidth * `service/kafka`: Updates service API and documentation * `service/opensearch`: Updates service API and documentation ### SDK Bugs * `aws/request`: Update Request Send to always ensure Request.HTTPResponse is populated. * Fixes [#4211](#4211)
Release v1.42.43 (2022-01-27) === ### Service Client Updates * `service/amplify`: Updates service documentation * `service/connect`: Updates service API and documentation * `service/ec2`: Updates service API * X2ezn instances are powered by Intel Cascade Lake CPUs that deliver turbo all core frequency of up to 4.5 GHz and up to 100 Gbps of networking bandwidth * `service/kafka`: Updates service API and documentation * `service/opensearch`: Updates service API and documentation ### SDK Bugs * `aws/request`: Update Request Send to always ensure Request.HTTPResponse is populated. * Fixes [#4211](#4211)
Confirm by changing [ ] to [x] below to ensure that it's a bug:
Describe the bug
We are using S3 API to manipulate files inside our S3 storage.
In some rare cases,
WithGetResponseHeader
may panic. If the request builds failed, before it was sent,request.HTTPResponse
would be nil. But the complete callback would be called anyway.Version of AWS SDK for Go?
Example: v1.41.0
Version of Go (
go version
)?go 1.17.5
To Reproduce (observed behavior)
Steps to reproduce the behavior (please share code or minimal repo)
Expected behavior
no panic occurs
The text was updated successfully, but these errors were encountered: