RocksDB stress test fixes + find_merge_thread() bugfix
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user