Repository navigation
node-mgr: keep encrypted runtimes alive when capture waiters expire - #1760
NancyKwongPerplexity wants to merge 1 commit into
Conversation
Port of #828 (by @zibi-pplx) onto current main. Node-manager's gRPC server applies a 120 s request timeout, while the encrypted Firecracker capture runs detached and can take longer. When the waiter expires, sandbox-manager sees the error with the runtime still live and rolls the sandbox back to paused, but the detached capture then went on to stop the VM for the seal, so the next resume or retry quarantined it. The capture handler now owns a cancellation token that fires when it is dropped. A capture still queued when the waiter goes away is skipped, and a capture already running finishes its I/O but returns Cancelled instead of stopping the runtime sandbox-manager rolled back to. Co-authored-by: Perplexity <noreply@perplexity.ai>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Port of #828 (by @zibi-pplx) onto current
main(paths moved fromcrates/libstocrates/l40_api). Narrow hotfix for the encrypted-suspend quarantine race.Problem
Node-manager's gRPC server enforces a 120 s request timeout (
GRPC_REQUEST_TIMEOUT), while the encrypted Firecracker capture runs detached and the client waits up to 960 s. When the server-side deadline fires, sbx-mgr sees a capture error with the runtime still live and rolls the sandbox back topaused. The detached capture then keeps going and stops the VM for the seal, so the next resume or retry quarantines the sandbox. That accounted for 43 of 47 quarantines over three days after BYOK volume growth.Change
capture_vm_stateowns aCancellationTokenthat fires when the handler future drops (drop_guard), threaded throughcreate_snapshot_inner→create_encrypted_snapshot.Cancelledinstead of callingstop_runtime_for_encrypted_seal.write_encrypted_snapshot_fileswith acfg(test)seam.Testing
dropping_capture_handler_skips_queued_capture_and_keeps_running_vm: queued → 0 captures / 0 stops; running → 1 / 0; waiter kept (control) → 1 / 1.cargo test -p pplx-space-node-mgr --lib(encrypt/snapshot filters) pass locally. The exception isexecution_fence::tests::stopped_unbound_snapshot_reaches_filesystem_without_allocating, which needs privileged host paths this sandbox lacks.Durable fix: #1761 (port of #837). This PR supersedes #828.
Created with Perplexity