-
Notifications
You must be signed in to change notification settings - Fork 340
refactor: migrate the job gc to mananger gc server #3991
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3991 +/- ##
==========================================
- Coverage 34.40% 34.34% -0.06%
==========================================
Files 341 342 +1
Lines 40084 40153 +69
==========================================
Hits 13789 13789
- Misses 25389 25456 +67
- Partials 906 908 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
9630719
to
632aa30
Compare
Signed-off-by: chlins <chlins.zhang@gmail.com>
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.
LGTM
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.
LGTM
This pull request introduces a new garbage collection (GC) framework for the Dragonfly Manager, replacing the previous implementation. It adds modular GC tasks for audits and jobs, refactors related code, and enhances maintainability. The most important changes are grouped into the following themes:
New Garbage Collection Framework:
GC
struct to manage tasks and their execution. Added support for registering and running multiple GC tasks (manager/gc/gc.go
).NewAuditGCTask
andNewJobGCTask
to define GC tasks for audits and jobs, including their intervals, timeouts, and batch sizes (manager/gc/audit.go
,manager/gc/job.go
). [1] [2]Task Recording and Results:
jobRecorder
to record the results of GC tasks, including purged items and errors, with support for task initialization (manager/gc/recorder.go
).Integration with Manager:
Server
struct inmanager/manager.go
, replacing the old GC implementation. GC tasks are now started and stopped alongside the server (manager/manager.go
). [1] [2] [3] [4]Removal of Old GC Implementation:
manager/job/gc.go
and related references inmanager/job/job.go
. This eliminates the hardcoded GC logic and replaces it with the new modular approach. [1] [2] [3]Refactoring Constants in Audit Service:
manager/service/audit.go
for better readability and consistency, includingAuditBufferSize
,AuditInsertBatchSize
, andAuditInsertInterval
. Updated their usage throughout the file. [1] [2] [3] [4]Description
Related Issue
#3811
Motivation and Context
Screenshots (if appropriate)
Types of changes
Checklist