Shut down CompOS VM after compilation completes
Add a method to CompOsInstance to consume the instance and shut it
down cleanly, allowing logs to be written. Call this when compilation
ends, before calling back to our client (since they might then drop
their reference to us, which could tear everything down prematurely).
I also created a method to combind the calls to quit() and
wait_for_shutdown() to reduce duplication.
I also increased the shutdown timeout, since my initial value doesn't
seem to be enough for CompOS (see b/236588647#comment38).
Bug: 236581575
Test: composd_cmd test-compile, observe logs
Change-Id: I34a227db0e377cb9aded57461379e17d0574ea0c
diff --git a/compos/src/compsvc.rs b/compos/src/compsvc.rs
index 9fa68d6..5d58221 100644
--- a/compos/src/compsvc.rs
+++ b/compos/src/compsvc.rs
@@ -20,7 +20,7 @@
use anyhow::{bail, Context, Result};
use binder_common::new_binder_exception;
-use log::error;
+use log::{error, info};
use rustutils::system_properties;
use std::default::Default;
use std::fs::read_dir;
@@ -153,8 +153,8 @@
}
fn quit(&self) -> BinderResult<()> {
- // TODO(b/236581575) Consider shutting down the binder server a bit more gracefully.
// When our process exits, Microdroid will shut down the VM.
+ info!("Received quit request, exiting");
std::process::exit(0);
}
}