-
Notifications
You must be signed in to change notification settings - Fork 394
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
🐛 Memory leak fix in mutating & validating webhooks #3026
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
LGTM label has been added. Git tree hash: 848ff26f77c7ecd62711cbd39ce3eaad77d8a2ab
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need locking? Is getHookSource
called for requests in separate goroutines?
Yes, Initially I thought it might be ok todo optimistic concurrency as its assignments (override basically) and reads but better safe than sorry |
/retest |
2 similar comments
/retest |
/retest |
LGTM label has been added. Git tree hash: 09f965cde2d66fc80f81f87ecdbe95c59c9a9a78
|
ping @sttts |
@@ -54,6 +55,9 @@ type Plugin struct { | |||
globalKubeSharedInformerFactory kcpkubernetesinformers.SharedInformerFactory | |||
|
|||
getAPIBindings func(clusterName logicalcluster.Name) ([]*apisv1alpha1.APIBinding, error) | |||
|
|||
managerLock sync.Mutex | |||
managersCache map[logicalcluster.Name]generic.Source |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this also means that nobody cleans those up when a logical cluster is gone, right? Maybe not as bad.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some ttl could help. If there is no request for 5min, remove them.
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: embik, sttts The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Summary
Each time

informer.Informer().AddEventHandler
is called go routine is spanned to monitor the event.configuration.NewMutatingWebhookConfigurationManagerForInformer
does just that so each timeplugin.Admit
is called we span a go routine. And so it infinity;Related issue(s)
Fixes #3016
Release Notes