Skip to content

Commit

Permalink
fix: Docker stopping will include a timeout (#2540)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: Aiden McClelland <[email protected]>
  • Loading branch information
3 people authored Dec 19, 2023
1 parent 5f047d2 commit 685e865
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion core/startos/src/manager/manager_seed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
Expand Down
1 change: 1 addition & 0 deletions core/startos/src/util/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ pub async fn stop_container(
signal: Option<Signal>,
) -> 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());
Expand Down

0 comments on commit 685e865

Please sign in to comment.