Skip to content
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

ProcessCache: Make GC interval configurable #3130

Merged
merged 3 commits into from
Nov 21, 2024

Conversation

kevsecurity
Copy link
Contributor

The process cache delays removal of exited processes. The first time the garbage collector sees a process (marked deletePending), it changes it to deleteReady. The second time it sees the process, it deletes it from the cache. The garbage collector runs every 30s.

This PR makes the GC interval configurable with the --process-cache-gc-interval switch.

@kevsecurity kevsecurity added the release-note/misc This PR makes changes that have no direct user impact. label Nov 18, 2024
Copy link

netlify bot commented Nov 18, 2024

Deploy Preview for tetragon ready!

Name Link
🔨 Latest commit 3b5888f
🔍 Latest deploy log https://app.netlify.com/sites/tetragon/deploys/673f6089ab964f0008e018a8
😎 Deploy Preview https://deploy-preview-3130--tetragon.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@kevsecurity kevsecurity force-pushed the pr/kevsecurity/process-cache-gc-interval-config branch from 3bfb130 to 43160b9 Compare November 18, 2024 17:52
@kevsecurity kevsecurity marked this pull request as ready for review November 19, 2024 13:59
@kevsecurity kevsecurity requested review from mtardy and a team as code owners November 19, 2024 13:59
Copy link
Contributor

@michi-covalent michi-covalent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you also make this configurable via a helm value as a follow up?

Copy link
Member

@mtardy mtardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, just two nits:

  • the duration of the tests
  • in Go naming we usually keep acronyms in uppercase, so somethingGCSomething, and gcSomething or GCSomething for unexported or exported.

pkg/sensors/exec/cache_test.go Outdated Show resolved Hide resolved
@kevsecurity kevsecurity force-pushed the pr/kevsecurity/process-cache-gc-interval-config branch from ee53f18 to fdc8e09 Compare November 21, 2024 16:17
The process cache delays removal of exited processes. The first time the
garbage collector sees a process (marked deletePending), it changes it
to deleteReady. The second time it sees the process, it deletes it from
the cache. The garbage collector runs every 30s.

This commit makes the GC interval configurable with the
--process-cache-gc-interval switch.

Signed-off-by: Kevin Sheldrake <[email protected]>
@kevsecurity kevsecurity force-pushed the pr/kevsecurity/process-cache-gc-interval-config branch from fdc8e09 to 3b5888f Compare November 21, 2024 16:32
Copy link
Contributor

@michi-covalent michi-covalent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@kevsecurity kevsecurity merged commit 9c992cc into main Nov 21, 2024
47 checks passed
@kevsecurity kevsecurity deleted the pr/kevsecurity/process-cache-gc-interval-config branch November 21, 2024 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants