mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #404] [CLOSED] fix: release snapshot filesystems before replacing volume drives #409
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#409
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/404
Author: @Primary33
Created: 10/21/2026
Status: ❌ Closed
Base:
main← Head:fix/snapshot-volume-replacement📝 Commits (1)
c5d84a9fix: release snapshot filesystems before replacing volume drives📊 Changes
21 files changed (+910 additions, -11 deletions)
View changed files
📝
docs/src/concepts/sandboxes/starting.md(+9 -0)📝
docs/src/concepts/volumes/sandbox-forks-and-snapshots.md(+6 -0)📝
src/api/generated/src/models.rs(+2 -0)📝
src/api/impls/image_build/worker.rs(+1 -0)📝
src/api/impls/sandbox.rs(+69 -2)📝
src/api/impls/volumes.rs(+127 -0)📝
src/api/openapi.yml(+12 -0)📝
src/orchestrator/service.rs(+3 -0)📝
src/orchestrator/tests.rs(+19 -0)📝
src/orchestrator/types.rs(+3 -0)📝
src/sandbox/firecracker/resources.rs(+13 -0)📝
src/sandbox/firecracker/sandbox.rs(+239 -6)📝
src/sandbox/guest_volumes.rs(+102 -2)📝
src/sandbox/mock.rs(+7 -1)📝
src/sandbox/mod.rs(+5 -0)📝
src/volume/mod.rs(+15 -0)📝
tests/integration.rs(+3 -0)📝
tests/integration/orchestrator.rs(+3 -0)📝
tests/integration/posix_startup_pack.rs(+1 -0)📝
tests/integration/snapshot.rs(+2 -0)...and 1 more files
📄 Description
What
Safely replace snapshot volume mounts, including empty arrays, changed paths, and read-only/writable transitions.
Why
Rebinding a drive while the guest retains its old filesystem can reuse a live superblock and cached data against a different disk, risking corruption.
Related issue
Identified while implementing #398. This fix branches directly from
main.Design and behavior changes
Compatibility and operations
Explicit replacement now returns HTTP 409 when captured processes or mount aliases retain an old filesystem. Close files, move process working directories off volumes, and remove aliases before recapturing affected templates. The snapshot format is unchanged.
Validation
Run on Ubuntu 24.04 with non-root test processes and isolated state:
make agentenv-server,make fmt,make clippy.make test-unit: 1210 passed; CLI tests run serially.cargo test -p agentenv --lib: 1021 passed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.