From 116ae66025c21c6c4c2ce4ed74c330f263aa3ec3 Mon Sep 17 00:00:00 2001 From: Alex Lyn Date: Thu, 30 Apr 2026 18:07:43 +0800 Subject: [PATCH] runtime-rs: Introduce a cached sandbox exit information Introduce an exit_info field in SandboxInner so sandbox teardown can store a stable exit result in runtime state. The follow-on WaitSandbox rework needs a place to keep the final SandboxExitInfo after the sandbox has already stopped. Without that cached result, later waiters would have no consistent value to return once the original stop event has passed. This change only adds the state holder. Behaviour changes follow in later commits. Signed-off-by: Alex Lyn --- src/runtime-rs/crates/runtimes/virt_container/src/sandbox.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/runtime-rs/crates/runtimes/virt_container/src/sandbox.rs b/src/runtime-rs/crates/runtimes/virt_container/src/sandbox.rs index 7337d50849..cd61d52439 100644 --- a/src/runtime-rs/crates/runtimes/virt_container/src/sandbox.rs +++ b/src/runtime-rs/crates/runtimes/virt_container/src/sandbox.rs @@ -75,6 +75,7 @@ use resource::{ResourceConfig, ResourceManager}; use runtime_spec as spec; use std::path::{Path, PathBuf}; use std::sync::Arc; +use std::time::SystemTime; use strum::Display; use tokio::sync::{mpsc::Sender, Mutex, RwLock}; use tracing::instrument; @@ -96,12 +97,14 @@ pub enum SandboxState { struct SandboxInner { state: SandboxState, + exit_info: Option, } impl SandboxInner { pub fn new() -> Self { Self { state: SandboxState::Init, + exit_info: None, } } }