Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Remove the max_elapsed_time limit from az_copy #2332

Merged
merged 3 commits into from
Sep 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/agent/onefuzz/src/az_copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ use tokio::process::Command;
use url::Url;

const RETRY_INTERVAL: Duration = Duration::from_secs(5);
const RETRY_COUNT: usize = 5;
const MAX_FAILURE_COUNT: usize = 5;
const MAX_RETRY_COUNT: usize = 10;

const ALWAYS_RETRY_ERROR_STRINGS: &[&str] = &[
// There isn't an ergonomic method to sync between the OneFuzz agent and fuzzers generating
Expand Down Expand Up @@ -151,7 +152,7 @@ async fn retry_az_impl(mode: Mode, src: &OsStr, dst: &OsStr, args: &[&str]) -> R
if !should_always_retry(&err) {
failure_count = failure_counter.fetch_add(1, Ordering::SeqCst);
}
if failure_count >= RETRY_COUNT {
if failure_count >= MAX_FAILURE_COUNT || attempt_count >= MAX_RETRY_COUNT {
Err(backoff::Error::Permanent(err))
} else {
Err(backoff::Error::transient(err))
Expand All @@ -164,6 +165,7 @@ async fn retry_az_impl(mode: Mode, src: &OsStr, dst: &OsStr, args: &[&str]) -> R
ExponentialBackoff {
current_interval: RETRY_INTERVAL,
initial_interval: RETRY_INTERVAL,
max_elapsed_time: None,
..ExponentialBackoff::default()
},
operation,
Expand Down