-
Notifications
You must be signed in to change notification settings - Fork 905
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
fix(metricprovider): reuse http.Transport for http.Client #3780
Conversation
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 <1146876+kevinji@users.noreply.github.com>
|
Published E2E Test Results 4 files 4 suites 3h 24m 50s ⏱️ For more details on these failures, see this check. Results for commit 8373787. |
Published Unit Test Results2 257 tests 2 257 ✅ 2m 58s ⏱️ Results for commit 8373787. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3780 +/- ##
==========================================
+ Coverage 83.97% 83.98% +0.01%
==========================================
Files 161 161
Lines 18492 18495 +3
==========================================
+ Hits 15528 15533 +5
+ Misses 2100 2099 -1
+ Partials 864 863 -1 ☔ View full report in Codecov by Sentry. |
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 <1146876+kevinji@users.noreply.github.com>
) 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 <1146876+kevinji@users.noreply.github.com>
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.
Checklist:
"fix(controller): Updates such and such. Fixes #1234"
.