diff --git a/src/runtime-rs/crates/runtimes/src/manager.rs b/src/runtime-rs/crates/runtimes/src/manager.rs index 4c4c4766a8..a729e0d349 100644 --- a/src/runtime-rs/crates/runtimes/src/manager.rs +++ b/src/runtime-rs/crates/runtimes/src/manager.rs @@ -138,14 +138,6 @@ impl RuntimeHandlerManagerInner { Ok(()) } - #[instrument] - async fn start_runtime_handler(&self) -> Result<()> { - if let Some(instance) = self.runtime_instance.as_ref() { - instance.sandbox.start().await.context("start sandbox")?; - } - Ok(()) - } - #[instrument] async fn try_init( &mut self, @@ -200,10 +192,6 @@ impl RuntimeHandlerManagerInner { .await .context("init runtime handler")?; - self.start_runtime_handler() - .await - .context("start runtime handler")?; - // the sandbox creation can reach here only once and the sandbox is created // so we can safely create the shim management socket right now // the unwrap here is safe because the runtime handler is correctly created @@ -411,6 +399,12 @@ impl RuntimeHandlerManager { .await .context("get runtime instance")?; + instance + .sandbox + .start() + .await + .context("start sandbox in task handler")?; + let container_id = container_config.container_id.clone(); let shim_pid = instance .container_manager