mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #181] fix(pool): discard warm firecracker entries whose process died while parked #233
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#233
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/181
Author: @epicvinny
Created: 8/18/2026
Status: 🔄 Open
Base:
main← Head:upstream/pool-dead-warm-entries📝 Commits (8)
ee28f6cfix(pool): discard warm firecracker entries whose process died while parked0b20901fix(pool): propagate liveness probe errors and defer dead warm cleanup0a88bc2fix(pool): harden dead warm entry cleanup against shutdown races and failures10e4cd8fix(pool): keep dead warm slot allocated until teardown completes90cd557fix(pool): harden dead-entry cleanup against overflow, poisoning, and leaksce5d2fffix(pool): close shutdown races in dead-entry cleanup finalizatione7ef3cbfix(pool): close dead-entry lost wakeup and schedule backoff retriesddf7377fix(pool): type dead-entry teardown failures and harden ip link del fallback📊 Changes
6 files changed (+1363 additions, -25 deletions)
View changed files
📝
crates/warm-pool/src/lib.rs(+158 -2)📝
src/sandbox/firecracker/instance.rs(+16 -0)📝
src/sandbox/firecracker/pool.rs(+982 -10)📝
src/sandbox/network/manager.rs(+69 -5)📝
src/sandbox/network/mod.rs(+1 -1)📝
src/sandbox/network/slot.rs(+137 -7)📄 Description
What
FirecrackerPool::try_acquirenow skips warm entries whose Firecracker process has already exited, discarding them (and releasing their network slot) instead of handing them to snapshot resume.Why
Parked warm processes run with
oom_score_adj=1000, so they are the first OOM-kill candidates and can die while idle in the pool. The acquire path popped whatever was parked and passed it straight to snapshot resume, which then failed on the dead process. Under host memory pressure this shows up as spurious sandbox-creation failures.Related issue
N/A. Small focused fix submitted directly per the contributing guide.
Scope and non-goals
Design and behavior changes
FirecrackerInstance::is_process_running()based ontry_wait.try_acquirepops until it finds a live entry. Dead entries are logged and discarded.block_on, sotry_acquirestays safe to call from async context.Compatibility and operations
Validation
make fmt(viacargo fmt --check)make clippy(viacargo clippy -p warm-pool; this change touchessrc/sandbox/firecracker/)make test-unit(scoped:cargo test -p warm-pool, 16 passed)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. Happy to run them on a Linux host if reviewers want.Risks and reviewer notes
src/sandbox/firecracker/pool.rs(acquire_live_warm,discard_dead_warm) andinstance.rs(is_process_running).Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.