-
Notifications
You must be signed in to change notification settings - Fork 1.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
Ensure that any bodies created in GetBody
are cleaned up
#429
Ensure that any bodies created in GetBody
are cleaned up
#429
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
Hello! Thank you for investigating this. @cjcotter @frankyn - the biggest client that uses this is storage AFAIK. Could one of you investigate this with fairly high priority? This may fix some of the other subtle issues we've been seeing. @kevinconaway Unfortunately this github repo is just a mirror of another git repo that uses gerrit for code review. Would you mind closing this PR and submitting a change request to gerrit? Our CONTRIBUTING.md has extensive guidance, and I'm happy to help too. If you prefer not, I can submit this for you, but unfortunately then you wouldn't get credit which is not as cool. |
Thanks, I'll do so. |
Created a gerrit CL here https://code-review.googlesource.com/c/google-api-go-client/+/48910 |
This PR fixes issues brought up in:
googleapis/google-cloud-go#1651
googleapis/google-cloud-go#1380
As best I understand it, the goroutines will leak when
GetBody
is called and the resulting body is not closed.This PR modifies
UploadRequest
to add any request bodies created byGetBody
to a list to be cleaned up by thecleanup
function that is returned. Previously, only the main request would be cleaned up but not any of those returned byGetBody
.I've verified that this fixes the issue in our environment.