Skip to content

Commit

Permalink
Issue #198: AppManager return timeout error when execut install comma…
Browse files Browse the repository at this point in the history
…nd in docker container
  • Loading branch information
weiqiushi committed Apr 12, 2023
1 parent 4c479a9 commit 1d8a79f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/service/app-manager/src/docker_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,16 +264,19 @@ impl DockerApi {

match child.wait_timeout(Duration::from_secs(INSTALL_CMD_TIME_OUT_IN_SECS))? {
None => {
error!("app {} run install cmd {} not return after {} secs, kill", id, &cmd, INSTALL_CMD_TIME_OUT_IN_SECS);
let msg = format!("app {} run install cmd {} not return after {} secs, kill", id, &cmd, INSTALL_CMD_TIME_OUT_IN_SECS);
error!("{}", &msg);
let _ = child.kill();
let _ = child.wait();
return Err(BuckyError::new(BuckyErrorCode::Timeout, msg));
}
Some(status) => {
if status.success() {
info!("app {} run install cmd {} success", id, &cmd);
} else {
error!("app {} run install cmd {}, exit code {}", id, &cmd, code_to_string(status.code()));
return Err(BuckyError::from(BuckyErrorCode::Failed));
let msg = format!("app {} run install cmd {}, exit code {}", id, &cmd, code_to_string(status.code()));
error!("{}", &msg);
return Err(BuckyError::new(BuckyErrorCode::Failed, msg));
}
}
}
Expand Down

0 comments on commit 1d8a79f

Please sign in to comment.