Repository navigation
workloadmanager: prevent inactive session GC starvation - #502
ANAMASGARD wants to merge 1 commit into
Conversation
Signed-off-by: Gaurav Chaudhary <chaudharygaurav2004@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #502 +/- ##
==========================================
+ Coverage 60.45% 63.41% +2.96%
==========================================
Files 35 36 +1
Lines 3616 3742 +126
==========================================
+ Hits 2186 2373 +187
+ Misses 1211 1139 -72
- Partials 219 230 +11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| # GC candidate pagination | ||
|
|
||
| Research date: 2026-11-03. Tracking issue: [#454](https://github.com/volcano-sh/agentcube/issues/454). | ||
|
|
There was a problem hiding this comment.
Please remove this file from the PR. As I understand it, it’s for agent analysis and shouldn’t be maintained in this repository.
What type of PR is this?
/kind bug
What this PR does / why we need it:
GC currently filters only the first 100 inactive sessions by their individual idle timeouts. When those sessions have long timeouts, an eligible session behind them is never examined.
This change adds Redis and Valkey ZSCAN traversal, retaining the cursor and pending session IDs across GC runs. Each candidate's session record and activity score are refreshed before evaluating its timeout. Empty pages, duplicate results, cancellation, and individual failures do not prevent traversal of later candidates. Expiry processing runs first with a bounded budget inside the existing two-minute GC deadline.
Existing listing methods and storage formats are preserved. Orphan index removal remains separate from #495.
Validation:
go test -mod=readonly ./pkg/...andgo test -mod=readonly -race ./pkg/....go vet -mod=readonly ./...,go build -mod=readonly ./cmd/...,make fmt-check, andmake lint.Which issue(s) this PR fixes:
Fixes #454
Special notes for your reviewer:
Prepared with AI assistance using Codex. The commit includes a DCO sign-off.
Progress is in memory and resets on restart. ZSCAN traverses active index entries too. Fresh activity reads do not make Kubernetes deletion atomic with concurrent activity updates. Native-store tests use a fake Kubernetes client; full cluster E2E was not run because the Docker daemon was unavailable. Reproduction commands and design tradeoffs are documented in
docs/research/gc-candidate-pagination.md.Does this PR introduce a user-facing change?: