mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #449] Run network slot setup on the blocking pool #443
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#443
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/449
Author: @iaroslav-reflection
Created: 10/28/2026
Status: 🔄 Open
Base:
main← Head:network-slot-blocking-pool📝 Commits (1)
958ca5cfix(sandbox): run network slot allocation and egress policy on the blocking pool📊 Changes
3 files changed (+253 additions, -16 deletions)
View changed files
📝
src/sandbox/firecracker/sandbox.rs(+66 -15)📝
src/sandbox/network/manager.rs(+186 -0)📝
src/sandbox/network/mod.rs(+1 -1)📄 Description
What
Network slot creation and the egress policy step now run on tokio's blocking pool. This covers both new start and resume. A new
SlotLeaseholds the slot while it moves between tasks. If the task is cancelled or crashes, the lease gives the slot back.Why
Making a new slot is slow and blocks the thread. It ran on the async workers. When 64 or more sandboxes started at once, all workers were stuck for about 60 s. Guests that were already running timed out.
Starting 128 sandboxes took 28 s with timeouts before. It takes 11 s with no timeouts now.
Changes
spawn_blocking.SlotLeasereturns the slot to theNetworkManagerwhen it is dropped.into_inner, unread result, cancelled task, crashed task.Not included
update_network_policyon a running sandbox still runs on the async worker.Risks
Testing
cargo fmtandcargo clippy -D warningspass.cargo test -p agentenv --lib -- network::manager: 31 passed, 1 ignored./dev/kvm, so CI will run them.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.