Skip to content

Commit

Permalink
task: fix leading files for exec process
Browse files Browse the repository at this point in the history
Signed-off-by: Zhang Tianyang <[email protected]>
  • Loading branch information
Burning1020 committed Jan 19, 2024
1 parent 98dbb0b commit d0a4148
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions vmm/task/src/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ use oci_spec::runtime::{LinuxResources, Process, Spec};
use runc::{options::GlobalOpts, Runc, Spawner};
use serde::Deserialize;
use tokio::{
fs::File,
fs::{remove_file, File},
io::{AsyncBufReadExt, AsyncRead, AsyncReadExt, BufReader},
process::Command,
sync::Mutex,
Expand Down Expand Up @@ -494,8 +494,10 @@ impl ProcessLifecycle<ExecProcess> for KuasarExecLifecycle {
}
}

async fn delete(&self, _p: &mut ExecProcess) -> containerd_shim::Result<()> {
async fn delete(&self, p: &mut ExecProcess) -> Result<()> {
self.exit_signal.signal();
let exec_pid_path = Path::new(self.bundle.as_str()).join(format!("{}.pid", p.id));
remove_file(exec_pid_path).await.unwrap_or_default();
Ok(())
}

Expand Down

0 comments on commit d0a4148

Please sign in to comment.