-
Notifications
You must be signed in to change notification settings - Fork 366
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve a couple of workqueue usages (#6692)
- In multicluster tests, stop using a pointer to the Custom Resource as the workqueue key, and instead use a NamespacedName value, which matches actual usage in the controller. - In the PodStore implementation (which keeps track of Pod deletion events with timestamps), use the Pod's UID as the workqueue key, instead of a pointer to the Pod object. It is uncommon to use a pointer as the workqueue key (even though it is functionally correct here). By using the string UID as the key, we could theoretically reduce memory usage, as we don't need to hold the Pod object in memory for a delay of 5 minutes, and the object could be garbage collected right after deletion. The Flow Aggregator in particular uses the PodStore for all Pods in the cluster (while for the Antrea Agent it is only local Pods), so storing the UID instead of the whole Pod object could make a big difference. Signed-off-by: Antonin Bas <[email protected]>
- Loading branch information
1 parent
85e1c67
commit 279f8f7
Showing
3 changed files
with
48 additions
and
40 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
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