From 3008fa06a12d117592c4313ee10abb4636000363 Mon Sep 17 00:00:00 2001 From: Denis Cornehl Date: Mon, 30 Mar 2026 08:34:14 +0200 Subject: [PATCH] archive index: increase repair-attempts for some race conditions --- crates/lib/docs_rs_storage/src/archive_index.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/lib/docs_rs_storage/src/archive_index.rs b/crates/lib/docs_rs_storage/src/archive_index.rs index b4f3f74cb..1cd9c2e4d 100644 --- a/crates/lib/docs_rs_storage/src/archive_index.rs +++ b/crates/lib/docs_rs_storage/src/archive_index.rs @@ -37,7 +37,7 @@ pub(crate) const ARCHIVE_INDEX_FILE_EXTENSION: &str = "index"; /// dummy size we assume in case of errors const DUMMY_FILE_SIZE: u64 = 1024 * 1024; // 1 MiB /// self-repair attempts -const FIND_ATTEMPTS: usize = 3; +const FIND_ATTEMPTS: usize = 5; #[derive(Debug)] struct Metrics { @@ -1214,7 +1214,11 @@ mod tests { fs::write(&cache_file, b"not-an-sqlite-index").await?; let remote_index_path = format!("{ARCHIVE_NAME}.{ARCHIVE_INDEX_FILE_EXTENSION}"); - let downloader = FlakyDownloader::new(remote_index_path, create_index_bytes(1).await?, 2); + let downloader = FlakyDownloader::new( + remote_index_path, + create_index_bytes(1).await?, + FIND_ATTEMPTS - 1, + ); let result = cache .find(ARCHIVE_NAME, LATEST_BUILD_ID, FILE_IN_ARCHIVE, &downloader)