webhook: don't use time.Tick to prevent leaks#2467
webhook: don't use time.Tick to prevent leaks#2467jetstack-bot merged 1 commit intocert-manager:masterfrom
Conversation
Signed-off-by: James Munnelly <james@munnelly.eu>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: munnerz 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 |
|
/lgtm |
|
/cherrypick release-0.12 |
|
@munnerz: once the present PR merges, I will cherry-pick it on top of release-0.12 in a new PR and assign it to you. 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/test-infra repository. |
|
@munnerz: new pull request created: #2468 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/test-infra repository. |
What this PR does / why we need it:
As per the comment on the Golang
time.Tickfunction:We were previously calling this function in a
forloop that by default, ticked every 10s. This means that over time, this resource 'leaks' thus causing an increase in CPU usage.I was specifically tipped off that this may be the case through this stackoverflow comment!
Which issue this PR fixes: fixes #2445
Special notes for your reviewer:
I've not run a build with this patch for long enough to verify this does indeed fix it, but I suspect it is the case given the majority of the time spent (based on profiling) was in handling futexes.
Release note:
/kind bug
/area webhook