RocksDB stress test fixes + find_merge_thread() bugfix

This commit is contained in:
mdecimus
2023-12-20 17:06:32 +01:00
parent f7313eecaf
commit d4aca0a8e0
28 changed files with 819 additions and 268 deletions

View File

@@ -28,3 +28,4 @@ form_urlencoded = "1.1.0"
human-size = "0.4.2"
futures = "0.3.28"
pwhash = "1.0.0"
rand = "0.8.5"

View File

@@ -29,6 +29,7 @@ use std::{
atomic::{AtomicUsize, Ordering},
Arc, Mutex,
},
time::Duration,
};
use console::style;
@@ -42,6 +43,7 @@ use mail_parser::mailbox::{
maildir,
mbox::{self, MessageIterator},
};
use rand::Rng;
use serde::de::DeserializeOwned;
use tokio::{fs::File, io::AsyncReadExt};
@@ -366,6 +368,10 @@ impl ImportCommands {
total_imported.fetch_add(1, Ordering::Relaxed);
}
Err(_) if retry_count < RETRY_ATTEMPTS => {
let backoff =
rand::thread_rng().gen_range(50..=300);
tokio::time::sleep(Duration::from_millis(backoff))
.await;
retry_count += 1;
continue;
}