-
Notifications
You must be signed in to change notification settings - Fork 870
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(metricprovider): reuse http.Transport for http.Client (#3780)
The current code creates a new http.Transport for each http.Client that is created, which leads to a leak in TCP connections due to keep-alive. Instead, reuse the same http.Transport between requests. According to the http.Transport docs, this is safe for concurrent use. Signed-off-by: Kevin Ji <[email protected]>
- Loading branch information
Showing
2 changed files
with
24 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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