Replace external reachability with an owned canary
This commit is contained in:
parent
0f6825c3b9
commit
31e9ab0f2d
1 changed files with 1409 additions and 1972 deletions
|
|
@ -180,12 +180,12 @@ where
|
|||
checkpoint!();
|
||||
self.start_connectivity_helper()?;
|
||||
checkpoint!();
|
||||
self.mark_network_ready()?;
|
||||
checkpoint!();
|
||||
self.arm_runtime_causal_edge()?;
|
||||
checkpoint!();
|
||||
self.start_sandbox()?;
|
||||
checkpoint!();
|
||||
self.mark_network_ready()?;
|
||||
checkpoint!();
|
||||
withdraw_waiter_admission(self).map_err(LifecycleError::Adapter)?;
|
||||
if !owner_live() {
|
||||
self.disconnect_session(session_id)?;
|
||||
|
|
@ -419,9 +419,7 @@ where
|
|||
pub fn mark_network_ready(&mut self) -> Result<(), LifecycleError<A::Error>> {
|
||||
self.startup_action(
|
||||
LifecycleAction::MarkNetworkReady,
|
||||
self.state
|
||||
.progress
|
||||
.has(RuntimeMilestone::ConnectivityHelper)
|
||||
self.state.progress.has(RuntimeMilestone::Sandbox)
|
||||
&& !self.state.progress.has(RuntimeMilestone::NetworkReady),
|
||||
|p| p.mark(RuntimeMilestone::NetworkReady),
|
||||
)
|
||||
|
|
@ -432,17 +430,22 @@ where
|
|||
pub fn arm_runtime_causal_edge(&mut self) -> Result<(), LifecycleError<A::Error>> {
|
||||
self.startup_action(
|
||||
LifecycleAction::ArmRuntimeCausalEdge,
|
||||
self.state.progress.has(RuntimeMilestone::NetworkReady)
|
||||
self.state
|
||||
.progress
|
||||
.has(RuntimeMilestone::ConnectivityHelper)
|
||||
&& !self.state.progress.has(RuntimeMilestone::CausalEdge),
|
||||
|p| p.mark(RuntimeMilestone::CausalEdge),
|
||||
)
|
||||
}
|
||||
|
||||
/// # Errors
|
||||
/// Refuses launch before network readiness and the causal edge are established.
|
||||
/// Refuses launch before helper attestation and the causal edge are established.
|
||||
pub fn start_sandbox(&mut self) -> Result<(), LifecycleError<A::Error>> {
|
||||
let allowed = self.state.progress.has(RuntimeMilestone::CausalEdge)
|
||||
&& self.state.progress.has(RuntimeMilestone::NetworkReady)
|
||||
&& self
|
||||
.state
|
||||
.progress
|
||||
.has(RuntimeMilestone::ConnectivityHelper)
|
||||
&& !self.state.progress.has(RuntimeMilestone::Sandbox);
|
||||
Self::require(
|
||||
LifecycleAction::StartSandbox,
|
||||
|
|
@ -692,6 +695,7 @@ where
|
|||
LifecycleAction::StopSandbox,
|
||||
self.state.progress.has(RuntimeMilestone::Sandbox),
|
||||
|p| {
|
||||
p.clear(RuntimeMilestone::NetworkReady);
|
||||
p.clear(RuntimeMilestone::Sandbox);
|
||||
p.clear(RuntimeMilestone::CausalEdge);
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue