diff --git a/src/agent/src/namespace.rs b/src/agent/src/namespace.rs index c821a0acb1..fd8bfbec28 100644 --- a/src/agent/src/namespace.rs +++ b/src/agent/src/namespace.rs @@ -100,7 +100,7 @@ impl Namespace { self.path = new_ns_path.clone().into_os_string().into_string().unwrap(); let hostname = self.hostname.clone(); - let new_thread = tokio::spawn(async move { + let new_thread = std::thread::spawn(move || { if let Err(err) = || -> Result<()> { let origin_ns_path = get_current_thread_ns_path(ns_type.get()); @@ -148,7 +148,7 @@ impl Namespace { }); new_thread - .await + .join() .map_err(|e| anyhow!("Failed to join thread {:?}!", e))??; Ok(self)