Skip to content

Commit fc3a6d0

Browse files
committed
[deployer] Retry timed out SSH attempts
1 parent b2c90ca commit fc3a6d0

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

deployer/src/aws/utils.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,15 @@ pub async fn ssh_execute_with_timeout(
7373
.arg("StrictHostKeyChecking=no")
7474
.arg(format!("ubuntu@{ip}"))
7575
.arg(command);
76-
let output = command_output(cmd, "ssh", ip, command_timeout).await?;
76+
let output = match command_output(cmd, "ssh", ip, command_timeout).await {
77+
Ok(output) => output,
78+
Err(err @ Error::CommandTimeout { .. }) => {
79+
warn!(ip, error = ?err, "SSH command timed out");
80+
sleep(RETRY_INTERVAL).await;
81+
continue;
82+
}
83+
Err(err) => return Err(err),
84+
};
7785
if output.status.success() {
7886
return Ok(());
7987
}

0 commit comments

Comments
 (0)