Always close body for HTTP requests in tests#10835
Merged
vmg merged 1 commit intovitessio:mainfrom Jul 27, 2022
Merged
Conversation
Contributor
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Bug fixes
Non-trivial changes
New/Existing features
Backward compatibility
|
vmg
approved these changes
Jul 26, 2022
Not closing the body leads to leaking goroutines for the reader / writer of the body. Found when validating that tests don't leak goroutines (to ensure other things get closed properly, but these cases where also found). Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
98b7e5a to
24835a6
Compare
vmg
approved these changes
Jul 26, 2022
rsajwani
pushed a commit
to planetscale/vitess
that referenced
this pull request
Aug 1, 2022
Not closing the body leads to leaking goroutines for the reader / writer of the body. Found when validating that tests don't leak goroutines (to ensure other things get closed properly, but these cases where also found). Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
dbussink
added a commit
to planetscale/vitess
that referenced
this pull request
Nov 30, 2022
Not closing the body leads to leaking goroutines for the reader / writer of the body. Found when validating that tests don't leak goroutines (to ensure other things get closed properly, but these cases where also found). Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
3 tasks
frouioui
pushed a commit
that referenced
this pull request
Nov 30, 2022
* Fix closing the body for HTTP requests (#11842) One of the easy things to miss that can cause resource leaks is not closing a response body for an HTTP request. There's a linter available to make it easier to catch this, so this enables that linter and fixes all the cases reported. This is almost all test cases, except for one production code path case in the throttler. Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com> * Always close body for HTTP requests (#10835) Not closing the body leads to leaking goroutines for the reader / writer of the body. Found when validating that tests don't leak goroutines (to ensure other things get closed properly, but these cases where also found). Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com> * Fix remaining body close issues Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com> Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Not closing the body leads to leaking goroutines for the reader / writer of the body.
Found when validating that tests don't leak goroutines (to ensure other things get closed properly, but these cases where also found).
Related Issue(s)
See also #10756 for another set of leak fixes.
Checklist