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 2d46cfcff7..9850a4cd4c 100644 --- a/src/runtime-rs/crates/runtimes/virt_container/src/sandbox.rs +++ b/src/runtime-rs/crates/runtimes/virt_container/src/sandbox.rs @@ -12,6 +12,7 @@ use agent::{ }; use anyhow::{anyhow, Context, Result}; use async_trait::async_trait; +use common::error::is_normal_oom_shutdown_error; use common::types::utils::option_system_time_into; use common::types::ContainerProcess; use common::{ @@ -925,8 +926,14 @@ impl Sandbox for VirtSandbox { } } Err(err) => { - warn!(sl!(), "failed to get oom event error {:?}", err); - break; + // Handle errors by type + if is_normal_oom_shutdown_error(&err) { + info!(sl!(), "oom watcher exit on sandbox shutdown: {:?}", err); + break; + } else { + warn!(sl!(), "failed to get oom event error {:?}", err); + continue; + } } } }