mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #182] feat(pool): decay warm-process refill target after idle TTL #235
Labels
No labels
bug
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/AgentENV#235
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/AgentENV/pull/182
Author: @epicvinny
Created: 8/18/2026
Status: 🔄 Open
Base:
main← Head:upstream/warm-pool-idle-ttl📝 Commits (8)
f5b3637feat(pool): decay warm-process refill target after idle TTL00784cefix(pool): persist idle decay state and normalize zero idle TTL2d4412ffix(pool): compute idle decay from one synchronized demand stateffdedf5fix(pool): re-validate maintenance drains against live demand statecebbd99fix(warm-pool): make acquisition pop and demand record atomic under drain lock order225c252fix(warm-pool): complete idle decay when pool is already at the decayed target1fb7b5afix(warm-pool): compute maintenance actions from the live pool length under both locks5acb283fix(warm-pool): complete idle decay only on a verified at-target pool length📊 Changes
8 files changed (+718 additions, -80 deletions)
View changed files
📝
config/default.toml(+4 -0)📝
crates/warm-pool/src/lib.rs(+660 -66)📝
docs/src/configuration/reference.md(+1 -0)📝
src/cfg.rs(+12 -0)📝
src/sandbox/firecracker/pool.rs(+5 -2)📝
src/sandbox/network/manager.rs(+31 -8)📝
storage/ublk-daemon/src/main.rs(+2 -0)📝
storage/ublk-daemon/src/server.rs(+3 -4)📄 Description
What
Adds
PoolConfig::idle_ttlto thewarm-poolcrate: when no warm-process acquisition happens within the TTL, the maintenance worker decays the geometric refill target back to the low watermark and drains the excess warm entries. Wired as[pool.firecracker] idle_ttl_secs(default 600,0disables decay).Why
The pool's fill target only ever ratchets up on acquisitions, so a single burst pins the excess warm Firecracker processes, and the memory they hold, for the lifetime of the server. On bursty shared hosts (business-hours sandbox creation, idle overnight) this wastes memory with no recourse short of restarting the server.
Related issue
Closes #180
Scope and non-goals
warm-pool, config plumbing (idle_ttl_secs), docs (config/default.toml, configuration reference), unit tests.idle_ttl: Nonesince they hold no guest processes).Design and behavior changes
idle_ttl_secs = 0preserves the exact previous ratchet behavior.Compatibility and operations
[pool.firecracker] idle_ttl_secs(default 600). Old builds ignore the key. Operators wanting the historical behavior set0.Validation
make fmt(viacargo fmt --check)make clippy(viacargo clippy -p warm-pool)make test-unit(scoped:cargo test -p warm-pool, 16 passed, incl. 3 new)make -C services test(required whenservices/changes)maketargetCommands and results:
Skipped checks and reasons: integration tests require root and
/dev/kvm, not available on the Windows dev box where this was written. The behavior has also been validated on our staging fleet (GKE KVM nodes) via the fork build.Risks and reviewer notes
0.crates/warm-pool/src/lib.rs(TTL bookkeeping in the maintenance loop) andsrc/cfg.rs(config wiring).Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.