Bind cold start to production authorities
This commit is contained in:
parent
a9c9cf7ab3
commit
b2f178d25e
1 changed files with 816 additions and 30 deletions
|
|
@ -282,17 +282,53 @@ where
|
|||
generation: Generation,
|
||||
session: Session,
|
||||
) -> Result<(), LifecycleError<A::Error>> {
|
||||
self.bootstrap_new_domain_while_owner_live(generation, session, || true)
|
||||
.map(|_| ())
|
||||
}
|
||||
|
||||
/// Drives cold start while checking the bootstrap owner's exact lifetime authority.
|
||||
///
|
||||
/// Returns `false` after applying the modeled bootstrap-owner disconnect transition.
|
||||
///
|
||||
/// # Errors
|
||||
/// Returns the first invalid transition, durable update, or production adapter failure.
|
||||
pub fn bootstrap_new_domain_while_owner_live(
|
||||
&mut self,
|
||||
generation: Generation,
|
||||
session: Session,
|
||||
mut owner_live: impl FnMut() -> bool,
|
||||
) -> Result<bool, LifecycleError<A::Error>> {
|
||||
let session_id = session.session_id;
|
||||
self.start_new_domain(generation, session)?;
|
||||
macro_rules! checkpoint {
|
||||
() => {
|
||||
if !owner_live() {
|
||||
self.disconnect_session(session_id)?;
|
||||
return Ok(false);
|
||||
}
|
||||
};
|
||||
}
|
||||
checkpoint!();
|
||||
self.create_trust_anchor()?;
|
||||
checkpoint!();
|
||||
self.start_runtime_supervisor()?;
|
||||
checkpoint!();
|
||||
self.lease_prepared_lower()?;
|
||||
checkpoint!();
|
||||
self.mount_state_anchor()?;
|
||||
checkpoint!();
|
||||
self.start_sidecar()?;
|
||||
checkpoint!();
|
||||
self.start_connectivity_helper()?;
|
||||
checkpoint!();
|
||||
self.mark_network_ready()?;
|
||||
checkpoint!();
|
||||
self.arm_runtime_causal_edge()?;
|
||||
checkpoint!();
|
||||
self.start_sandbox()?;
|
||||
self.publish_domain()
|
||||
checkpoint!();
|
||||
self.publish_domain()?;
|
||||
Ok(true)
|
||||
}
|
||||
|
||||
/// # Errors
|
||||
|
|
|
|||
Loading…
Reference in a new issue