Skip to content
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

Conversation

kevinconaway
Copy link
Contributor

@kevinconaway kevinconaway commented Nov 25, 2019

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 by GetBody to a list to be cleaned up by the cleanup function that is returned. Previously, only the main request would be cleaned up but not any of those returned by GetBody.

I've verified that this fixes the issue in our environment.

@googlebot
Copy link

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 @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added the cla: no This human has *not* signed the Contributor License Agreement. label Nov 25, 2019
@kevinconaway
Copy link
Contributor Author

@googlebot I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Nov 25, 2019
@jeanbza
Copy link
Contributor

jeanbza commented Nov 25, 2019

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.

@kevinconaway
Copy link
Contributor Author

Thanks, I'll do so.

@kevinconaway
Copy link
Contributor Author

@jeanbza jeanbza closed this Dec 3, 2019
shawn-liangg pushed a commit to shawn-liangg/google-api-go-client that referenced this pull request Mar 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants