Severity: 🟡 · Criterion: K7 / K6 · Phase: P3 · Status (review): 🆕
File(s): src/DockerUpdateGuard/Images/ScanCleanupBackgroundService.cs:103-167
Finding
Each category (old samples, snapshots, findings, scan runs, tag candidates) is
materialized via ToListAsync() and then RemoveRange'd. Cleanup specifically targets large backlogs,
so very large quantities are loaded into memory. ExecuteDeleteAsync (in dependency
order or with DB cascade) avoids the materialization. (The materialization may be deliberate
to let EF handle the dependent deletions across the graph.)
Impact
Unnecessary materialization; at scale it undermines the purpose of the cleanup.
Rarely executed (CleanupIntervalMinutes), hence 🟡.
Recommendation
Switch to ExecuteDeleteAsync in dependency order or use the FK cascade
rules (P4).
Auto-generated from the repository code review. Source of truth: docs/review/findings.md → F-027 (P3), branch review/review-analysis-plan.
Severity: 🟡 · Criterion: K7 / K6 · Phase: P3 · Status (review): 🆕
File(s):
src/DockerUpdateGuard/Images/ScanCleanupBackgroundService.cs:103-167Finding
Each category (old samples, snapshots, findings, scan runs, tag candidates) is
materialized via
ToListAsync()and thenRemoveRange'd. Cleanup specifically targets large backlogs,so very large quantities are loaded into memory.
ExecuteDeleteAsync(in dependencyorder or with DB cascade) avoids the materialization. (The materialization may be deliberate
to let EF handle the dependent deletions across the graph.)
Impact
Unnecessary materialization; at scale it undermines the purpose of the cleanup.
Rarely executed (
CleanupIntervalMinutes), hence 🟡.Recommendation
Switch to
ExecuteDeleteAsyncin dependency order or use the FK cascaderules (P4).
Auto-generated from the repository code review. Source of truth:
docs/review/findings.md→ F-027 (P3), branchreview/review-analysis-plan.