Exclude image preparation from client startup deadline
This commit is contained in:
parent
8334fd379f
commit
55eed08db7
2 changed files with 106 additions and 22 deletions
|
|
@ -306,11 +306,11 @@ pub struct BootstrapChild {
|
|||
}
|
||||
|
||||
impl BootstrapChild {
|
||||
/// Reads the private bootstrap acquisition status byte.
|
||||
/// Reads the next private bootstrap status byte.
|
||||
///
|
||||
/// # Errors
|
||||
/// Returns an error when the child closes or corrupts its status channel.
|
||||
pub fn acquisition_status(&mut self) -> io::Result<u8> {
|
||||
pub fn bootstrap_status(&mut self) -> io::Result<u8> {
|
||||
let mut status = [0_u8; 1];
|
||||
self.status.read_exact(&mut status)?;
|
||||
Ok(status[0])
|
||||
|
|
|
|||
|
|
@ -56,12 +56,13 @@ fn bootstrap_child_retains_exact_pipe_owner_and_pidfd_reap() {
|
|||
let (reader, writer) = pipe_with(PipeFlags::CLOEXEC).unwrap();
|
||||
let target = TargetCommand::new("/bin/sh")
|
||||
.argument("-c")
|
||||
.argument("printf L; read -r _ || exit 0")
|
||||
.argument("printf LR; read -r _ || exit 0")
|
||||
.with_lifetime_pipe_parent_edge();
|
||||
let mut child = child_broker()
|
||||
.spawn_bootstrap(&target, File::from(reader))
|
||||
.unwrap();
|
||||
assert_eq!(child.acquisition_status().unwrap(), b'L');
|
||||
assert_eq!(child.bootstrap_status().unwrap(), b'L');
|
||||
assert_eq!(child.bootstrap_status().unwrap(), b'R');
|
||||
assert!(!child.has_exited().unwrap());
|
||||
drop(writer);
|
||||
let status = child.reap().unwrap();
|
||||
|
|
|
|||
Loading…
Reference in a new issue