Fix idle connection leak in prober#1139
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1139 +/- ##
==========================================
+ Coverage 93.33% 93.34% +0.01%
==========================================
Files 35 35
Lines 1005 1007 +2
==========================================
+ Hits 938 940 +2
Misses 53 53
Partials 14 14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
linkvt
left a comment
There was a problem hiding this comment.
LGTM in general, minor comment about the fallback when context has no value set.
withProbeAddr could in theory be inlined but not really important.
| // because the HTTP client validates that the hostname (not the Host header) matches the server | ||
| // TLS certificate Common Name or Alternative Names. Therefore, http.Request.URL is set to the | ||
| // hostname and it is substituted here with the target IP. | ||
| if target, ok := ctx.Value(probeAddrKey{}).(string); ok { |
There was a problem hiding this comment.
Not sure if we want to fallback here, panicking might be a good approach as we expect the probeaddr always to be set?
|
Any reason why we can't just enable |
The soak test is running with the patch below. So far it more then halved the memory footprint. |
|
Curious - how does the soak test work? Is it creating a knative service or something every minute etc? |
In a nutshell it should be maintaining a pool of ~100 ksvc in this case over long period of time. On this ksvc set performing periodic re-create with same name, add new revision, send request to scale from zero etc. |
Do you have a script? |
3ab8730 to
61c8882
Compare
AFAIK there's a golang implementation of test framework that manages the soak loop scenario and collects evidence. @maschmid would need to fill in more gaps. @dprotaso I've updated the PR to do a minimal change with |
|
/lgtm thanks! |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dprotaso, dsimansk The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/cherry-pick release-1.21 |
|
@dsimansk: new pull request created: #1141 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
@dsimansk: new pull request created: #1142 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Changes
Per soak tests run on our Serverless distro with serving + net-kourier @maschmid observed a liner memory increase over time that may lead to OOM. It was traced down to idle connection pool steadily increasing.
/cc @maschmid @linkvt @dprotaso