Skip to content

Commit 9bbb191

Browse files
committed
Remove container cleanup after checkpoint
It wasn't supposed to do that
1 parent 6af91ae commit 9bbb191

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

src/cli/run.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -611,10 +611,10 @@ impl super::CLI for Run {
611611
info!("Application exited with exit_code=0");
612612
}
613613

614-
// The existance of the app config tells indicates if the app is
615-
// currently running. This is used in is_app_running().
614+
// The existance of the app config indicates if the app may b
615+
// running (see is_app_running()), so it's better to take it out.
616616
if let Err(e) = AppConfig::remove() {
617-
error!("{}", e);
617+
error!("{}, but it's okay", e);
618618
}
619619

620620
app_exit_result

src/container.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -397,12 +397,8 @@ fn prepare_pty_namespace_and_reopen_fds() -> Result<()> {
397397
// PID namespace
398398
//////////////////////////////////
399399

400-
fn monitor_container(container_pid: Pid) -> ! {
401-
let result = monitor_child(container_pid);
402-
403-
cleanup_current_container();
404-
405-
if let Err(e) = result {
400+
fn container_monitor_exit_process(monitor_child_result: Result<()>) -> ! {
401+
if let Err(e) = monitor_child_result {
406402
// Our child logs errors when exiting, so we skip logging in this case
407403
match e.downcast_ref::<ChildDied>() {
408404
Some(ChildDied::Exited(_)) => {},
@@ -432,7 +428,9 @@ fn prepare_pid_namespace() -> Result<()> {
432428
write_container_pid_file(container_pid)
433429
.map_err(|e| { let _ = kill(container_pid, signal::SIGKILL); e })?;
434430

435-
monitor_container(container_pid);
431+
let result = monitor_child(container_pid);
432+
cleanup_current_container();
433+
container_monitor_exit_process(result);
436434
// unreachable
437435
}
438436

@@ -555,7 +553,8 @@ fn nsenter(name: &str) -> Result<()> {
555553
raise_all_effective_caps_to_ambient()?;
556554

557555
if let ForkResult::Parent { child: pid } = fork()? {
558-
monitor_container(pid);
556+
let result = monitor_child(pid);
557+
container_monitor_exit_process(result);
559558
// unreachable
560559
}
561560

0 commit comments

Comments
 (0)