mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-25 11:13:15 +00:00
Merge pull request #1447 from liubin/liubin/fix-1369
agent: Stop receive message from Receiver if got None
This commit is contained in:
commit
2c42be0ca6
@ -191,7 +191,10 @@ async fn register_memory_event(
|
||||
let content = fs::read_to_string(path.clone());
|
||||
info!(
|
||||
sl!(),
|
||||
"OOM event for container: {}, content: {:?}", &containere_id, content
|
||||
"cgroup event for container: {}, path: {:?}, content: {:?}",
|
||||
&containere_id,
|
||||
&path,
|
||||
content
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -317,7 +317,13 @@ impl Sandbox {
|
||||
tokio::spawn(async move {
|
||||
loop {
|
||||
let event = rx.recv().await;
|
||||
// None means the container has exited,
|
||||
// and sender in OOM notifier is dropped.
|
||||
if event.is_none() {
|
||||
return;
|
||||
}
|
||||
info!(logger, "got an OOM event {:?}", event);
|
||||
|
||||
let _ = tx
|
||||
.send(container_id.clone())
|
||||
.await
|
||||
|
Loading…
Reference in New Issue
Block a user