MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / stop

Method stop

supervisor/src/process.rs:284–301  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

282 }
283
284 pub fn stop(&self) -> Result<()> {
285 let mut state = self.lock();
286 state.started = false;
287 let is_running = state.status.is_running();
288 let Some(stop_tx) = state.kill_tx.take() else {
289 if is_running {
290 bail!("Missing kill tx for process");
291 }
292 return Ok(());
293 };
294 match stop_tx.send(()) {
295 Ok(()) => Ok(()),
296 Err(()) => match is_running {
297 true => bail!("Failed to send stop signal to process"),
298 false => Ok(()),
299 },
300 }
301 }
302
303 pub fn info(&self) -> ProcessInfo {
304 let state = self.lock();

Callers 4

stopFunction · 0.45
stop_vmMethod · 0.45
finish_remove_vmMethod · 0.45
sv_stopMethod · 0.45

Calls 3

is_runningMethod · 0.80
sendMethod · 0.80
lockMethod · 0.45

Tested by

no test coverage detected