handle connect problems

This commit is contained in:
GroovieGermanikus 2024-01-18 13:38:15 +01:00
parent def0853c0f
commit ca55a8bba8
No known key found for this signature in database
GPG Key ID: 5B6EB831A5CD2015
1 changed files with 21 additions and 25 deletions

View File

@ -355,35 +355,31 @@ pub fn create_geyser_reconnecting_task(
client.subscribe_once2(subscribe_filter)) client.subscribe_once2(subscribe_filter))
.await; .await;
let subscribe_result; match subscribe_result_timeout {
match subscribe_result_timeout.map_err(|_| Status::unknown("unspecific subscribe timeout")) { Ok(subscribe_result) => {
Ok(fooo) => { match subscribe_result {
subscribe_result = fooo; Ok(geyser_stream) => {
Ready(attempt, geyser_stream)
}
Err(GeyserGrpcClientError::TonicError(_)) => {
warn!("! subscribe failed on {} - retrying", grpc_source);
RecoverableConnectionError(attempt)
}
Err(GeyserGrpcClientError::TonicStatus(_)) => {
warn!("! subscribe failed on {} - retrying", grpc_source);
RecoverableConnectionError(attempt)
}
// non-recoverable
Err(unrecoverable_error) => {
error!("! subscribe to {} failed with unrecoverable error: {}", grpc_source, unrecoverable_error);
FatalError(attempt)
}
}
} }
Err(_elapsed) => { Err(_elapsed) => {
todo!() warn!("! subscribe failed with timeout on {} - retrying", grpc_source);
}
}
// maybe not optimal
// let subscribe_result = subscribe_result_timeout.map_err(|_| Status::unknown("unspecific subscribe timeout"));
match subscribe_result {
Ok(geyser_stream) => {
Ready(attempt, geyser_stream)
}
Err(GeyserGrpcClientError::TonicError(_)) => {
warn!("! subscribe failed on {} - retrying", grpc_source);
RecoverableConnectionError(attempt) RecoverableConnectionError(attempt)
} }
Err(GeyserGrpcClientError::TonicStatus(_)) => {
warn!("! subscribe failed on {} - retrying", grpc_source);
RecoverableConnectionError(attempt)
}
// non-recoverable
Err(unrecoverable_error) => {
error!("! subscribe to {} failed with unrecoverable error: {}", grpc_source, unrecoverable_error);
FatalError(attempt)
}
} }
} }
RecoverableConnectionError(attempt) => { RecoverableConnectionError(attempt) => {