mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[GH-ISSUE #99] Pause allocation failures leave the sandbox detached in Pausing #34
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#34
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?
Originally created by @morluto on GitHub (Jul 31, 2026).
Original GitHub issue: https://github.com/kvcache-ai/AgentENV/issues/99
What happened?
If paused-sandbox artifact-root allocation fails,
pause_sandboxreturns an error after it has already removed the sandbox's runtime handle and proxy route. The metadata remains inPausing, so the still-running sandbox is no longer reachable and a later pause cannot retry the operation.This was reproduced at
f41abb21324f6b0520abf34b7720aa260ddd10ebwith the in-memory orchestrator and a persister that deterministically fails its nextallocate_artifact_rootcall. No KVM or privileged host setup is required.Where does it happen?
pause_sandbox_innerprotects the paused runtime artifacts and then callsdetach_sandbox_handle_and_routebefore allocating the artifact root:src/orchestrator/service.rs: the handle and route are detached immediately beforeSandboxPersister::allocate_artifact_root.await?, so its error bypasses the rollback implemented for latersandbox.pause(...)and persistence failures.The resulting control flow is:
How can we reproduce it?
RecordingPersister.RecordingPersister::fail_next(RecordingCall::AllocateArtifactRoot).pause_sandbox.SandboxPersistenceFailed.Running, the runtime handle and proxy route have already been removed, and the temporaryPausedSandboximage ownership is not released by this path.A regression test can exercise the behavior entirely through the existing mock backend and persister seam. The important assertion is not only that the first call fails: after rollback, the sandbox must be routable and a second
pause_sandboxcall must succeed.What did you expect to happen?
Artifact-root allocation happens before the backend mutates the running VM, so this failure should be recoverable. The operation should:
Pausingback toRunning;PausedSandboximage references; andIf restoring metadata itself fails, the returned error should preserve both the allocation failure and rollback failure rather than reporting a clean recovery.
Acceptance criteria
Runningwith no paused state, the runtime handle is present, and the proxy route is ready.RuntimeImageOwner::PausedSandboxreference is released.Paused.Anything else we need to know?
This report is scoped to the recoverable allocation failure before
SandboxBackend::pauseis invoked. It does not propose changing terminal backend pause failures, stop-failure handling, or restart-time persistence cleanup.Environment for the deterministic reproduction: Linux x86_64, Rust stable toolchain. The proof is unit-level and does not require
/dev/kvmbecause the failure occurs before backend pause execution.