From 685e865b428b98141e6b082a41bfd909fad59095 Mon Sep 17 00:00:00 2001 From: J H <2364004+Blu-J@users.noreply.github.com> Date: Tue, 19 Dec 2023 10:16:18 -0700 Subject: [PATCH] fix: Docker stopping will include a timeout (#2540) * fix sdk build script * fix: Docker stopping will include a timeoute So the timeout that was included in the original is not working therefore we move to a doublinig with a timeout * fix: Adding in the missing suggestions that Aiden has poinited out * Update install-sdk.sh * Update install-sdk.sh --------- Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> Co-authored-by: Aiden McClelland --- core/startos/src/manager/manager_seed.rs | 10 +++++++++- core/startos/src/util/docker.rs | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/core/startos/src/manager/manager_seed.rs b/core/startos/src/manager/manager_seed.rs index f90e7739f..35ebee409 100644 --- a/core/startos/src/manager/manager_seed.rs +++ b/core/startos/src/manager/manager_seed.rs @@ -29,7 +29,15 @@ impl ManagerSeed { ) .await { - Err(e) if e.kind == ErrorKind::NotFound => (), // Already stopped + Err(e) if e.kind == ErrorKind::NotFound => { + tracing::info!( + "Command for package {command_id} should already be stopped", + command_id = &self.manifest.id + ); + } // Already stopped + Err(e) if e.kind == ErrorKind::Timeout => { + tracing::warn!("Command for package {command_id} had to be timed out, but we have dropped which means it should be killed", command_id = &self.manifest.id); + } // Already stopped In theory a => a?, } Ok(()) diff --git a/core/startos/src/util/docker.rs b/core/startos/src/util/docker.rs index fb6bc15f4..db6aa30c0 100644 --- a/core/startos/src/util/docker.rs +++ b/core/startos/src/util/docker.rs @@ -113,6 +113,7 @@ pub async fn stop_container( signal: Option, ) -> Result<(), Error> { let mut cmd = Command::new(CONTAINER_TOOL); + let mut cmd = cmd.timeout(timeout); cmd.arg("stop"); if let Some(dur) = timeout { cmd.arg("-t").arg(dur.as_secs().to_string());