From f1318fa87f439b022c19a0bc8dbf1ca664779ba9 Mon Sep 17 00:00:00 2001 From: ningmingxiao Date: Fri, 27 Sep 2024 18:02:49 +0800 Subject: [PATCH] fix exec hang when tx channel is full --- crates/runc-shim/src/service.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/runc-shim/src/service.rs b/crates/runc-shim/src/service.rs index 2decc527..d4742a98 100644 --- a/crates/runc-shim/src/service.rs +++ b/crates/runc-shim/src/service.rs @@ -159,6 +159,9 @@ async fn process_exits( if let Subject::Pid(pid) = e.subject { debug!("receive exit event: {}", &e); let exit_code = e.exit_code; + let containers = containers.clone(); + let tx = tx.clone(); + tokio::spawn(async move { for (_k, cont) in containers.lock().await.iter_mut() { let bundle = cont.bundle.to_string(); // pid belongs to container init process @@ -204,7 +207,7 @@ async fn process_exits( break; } } - } + }}); } } monitor_unsubscribe(s.id).await.unwrap_or_default();