MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / mark_sandbox_error

Method mark_sandbox_error

crates/openshell-server/src/compute/mod.rs:840–876  ·  view source on GitHub ↗
(&self, sandbox: &Sandbox, reason: &str, message: &str)

Source from the content-addressed store, hash-verified

838 }
839
840 async fn mark_sandbox_error(&self, sandbox: &Sandbox, reason: &str, message: &str) {
841 let _guard = self.sync_lock.lock().await;
842 let sandbox_id = sandbox.object_id().to_string();
843 let reason = reason.to_string();
844 let message = message.to_string();
845 match self
846 .store
847 .update_message_cas::<Sandbox, _>(&sandbox_id, 0, |s| {
848 s.set_phase(SandboxPhase::Error as i32);
849 let name = s.object_name().to_string();
850 upsert_ready_condition(
851 &mut s.status,
852 &name,
853 SandboxCondition {
854 r#type: "Ready".to_string(),
855 status: "False".to_string(),
856 reason: reason.clone(),
857 message: message.clone(),
858 last_transition_time: String::new(),
859 },
860 );
861 })
862 .await
863 {
864 Ok(updated) => {
865 self.sandbox_index.update_from_sandbox(&updated);
866 self.sandbox_watch_bus.notify(&sandbox_id);
867 }
868 Err(err) => {
869 warn!(
870 sandbox_id = %sandbox_id,
871 error = %err,
872 "Failed to persist sandbox error state during startup resume"
873 );
874 }
875 }
876 }
877
878 async fn lease_coordinator(self: Arc<Self>, mut shutdown_rx: watch::Receiver<bool>) {
879 use lease::{LEASE_ACQUIRE_INTERVAL, LEASE_TTL, ReconcilerLease};

Callers 1

Calls 6

upsert_ready_conditionFunction · 0.85
object_idMethod · 0.80
set_phaseMethod · 0.80
object_nameMethod · 0.80
update_from_sandboxMethod · 0.80
notifyMethod · 0.80

Tested by

no test coverage detected