mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #252] [MERGED] fix(volume): avoid VM snapshots during sandbox deletion #293
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#293
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/252
Author: @yingdi-shan
Created: 9/7/2026
Status: ✅ Merged
Merged: 9/9/2026
Merged by: @yingdi-shan
Base:
main← Head:fix/volume-delete-without-vm-snapshot📝 Commits (1)
027befcfix(volume): delete sandboxes without capturing VM state📊 Changes
15 files changed (+911 additions, -134 deletions)
View changed files
📝
docs/src/concepts/volumes.md(+10 -0)📝
scripts/tests/e2e/suites/15_volume.sh(+16 -0)📝
src/orchestrator/service.rs(+147 -80)📝
src/orchestrator/tests.rs(+250 -11)📝
src/sandbox/backend.rs(+12 -0)📝
src/sandbox/extra_drive.rs(+10 -1)📝
src/sandbox/firecracker/overlaybd_snapshot.rs(+6 -4)📝
src/sandbox/firecracker/sandbox.rs(+133 -2)📝
src/sandbox/mock.rs(+29 -2)📝
src/sandbox/process.rs(+72 -31)📝
src/sandbox/ublk/device.rs(+1 -1)📝
src/volume.rs(+17 -0)📝
storage/ublk-daemon/src/client.rs(+36 -2)📝
storage/ublk-daemon/tests/ublk_daemon_test.rs(+2 -0)📝
tests/integration/snapshot_attached_drive.rs(+170 -0)📄 Description
What
Delete sandboxes with mounted volumes by freezing the writable filesystems, sealing and publishing their layers, and stopping the VM. Deletion no longer captures disposable memory, rootfs, or VM state.
Why
The existing deletion path pauses the entire sandbox to preserve volume writes. A volume-only checkpoint avoids that work and leaves a clean filesystem journal for the next mount.
Related issue
Extracted from #247 alongside #253 (OCI UID/GID startup) and #254 (BuildKit). The layer-reuse optimization in #249 remains separate.
Scope and non-goals
Mounted-volume deletion, timeout eviction, failure recovery, regression tests, and volume documentation. BuildKit integration and OCI UID/GID resolution are submitted separately.
Design and behavior changes
Compatibility and operations
Validation
make fmtmake clippymake test-unitCommands and results:
The VM test passed with multiple volumes, recovery after a partial freeze failure, thaw/reseal, subPath mounts, a non-root default user, and dirty-file preservation in a replacement VM. It ran as a non-root user through the repository capability runner with isolated state and dependency copies. No timing benchmark was run; the regression tests verify that deletion does not invoke a full VM pause/snapshot. Go and generated API checks do not apply.
Risks and reviewer notes
Review deletion ordering in
src/orchestrator/service.rsand freeze recovery insrc/sandbox/firecracker/sandbox.rs. Filesystem freezing flushes filesystem state; application buffers still require application-level coordination. Guest root-selection helpers overlap identically with the OCI startup fix and merge cleanly.Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.