mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-31 01:09:23 +00:00
logging(disks): Propogate storage disk init error, improve logging (#1825)
Co-authored-by: houseme <housemecn@gmail.com>
This commit is contained in:
@@ -217,7 +217,7 @@ impl ECStore {
|
||||
let mut times = 0;
|
||||
let mut interval = 1;
|
||||
loop {
|
||||
if let Ok(fm) = store_init::connect_load_init_formats(
|
||||
match store_init::connect_load_init_formats(
|
||||
first_is_local,
|
||||
&disks,
|
||||
pool_eps.set_count,
|
||||
@@ -226,15 +226,18 @@ impl ECStore {
|
||||
)
|
||||
.await
|
||||
{
|
||||
break fm;
|
||||
Ok(fm) => break Ok(fm),
|
||||
// Wrap the final error if we are giving up
|
||||
Err(e) if times >= 10 => {
|
||||
break Err(Error::other(format!("can not get formats after {} retries, last error: {e}", times)));
|
||||
}
|
||||
// Retrying so just drop the error
|
||||
Err(_) => {}
|
||||
}
|
||||
times += 1;
|
||||
if interval < 16 {
|
||||
interval *= 2;
|
||||
}
|
||||
if times > 10 {
|
||||
return Err(Error::other("can not get formats"));
|
||||
}
|
||||
info!("retrying get formats after {:?}", interval);
|
||||
select! {
|
||||
_ = tokio::signal::ctrl_c() => {
|
||||
@@ -245,7 +248,7 @@ impl ECStore {
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}?;
|
||||
|
||||
if deployment_id.is_none() {
|
||||
deployment_id = Some(fm.id);
|
||||
|
||||
Reference in New Issue
Block a user