Skip to content
Snippets Groups Projects
Commit 1ada9710 authored by Georgy Moshkin's avatar Georgy Moshkin :speech_balloon:
Browse files

fix: used to fail to start when io error happened

parent 5a5a1919
No related branches found
No related tags found
1 merge request!636Fix retry io error
...@@ -513,12 +513,17 @@ fn start_join(args: &args::Run, instance_address: String) { ...@@ -513,12 +513,17 @@ fn start_join(args: &args::Run, instance_address: String) {
break resp; break resp;
} }
Err(TntError::Tcp(e)) => { Err(TntError::Tcp(e)) => {
tlog!(Warning, "join request failed: {e}, retry..."); tlog!(Warning, "join request failed: {e}, retrying...");
fiber::sleep(timeout.saturating_sub(now.elapsed()));
continue;
}
Err(TntError::IO(e)) => {
tlog!(Warning, "join request failed: {e}, retrying...");
fiber::sleep(timeout.saturating_sub(now.elapsed())); fiber::sleep(timeout.saturating_sub(now.elapsed()));
continue; continue;
} }
Err(e) => { Err(e) => {
tlog!(Error, "join request failed: {e}"); tlog!(Error, "join request failed: {e}, shutting down...");
std::process::exit(-1); std::process::exit(-1);
} }
} }
...@@ -654,6 +659,11 @@ fn postjoin(args: &args::Run, storage: Clusterwide, raft_storage: RaftSpaceAcces ...@@ -654,6 +659,11 @@ fn postjoin(args: &args::Run, storage: Clusterwide, raft_storage: RaftSpaceAcces
fiber::sleep(timeout.saturating_sub(now.elapsed())); fiber::sleep(timeout.saturating_sub(now.elapsed()));
continue; continue;
} }
Err(timeout::Error::Failed(TntError::IO(e))) => {
tlog!(Warning, "failed to activate myself: {e}, retrying...");
fiber::sleep(timeout.saturating_sub(now.elapsed()));
continue;
}
Err(e) => { Err(e) => {
tlog!(Error, "failed to activate myself: {e}, shutting down..."); tlog!(Error, "failed to activate myself: {e}, shutting down...");
std::process::exit(-1); std::process::exit(-1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment