retry all tcp on all IO errors recieved from UDP requests
This commit is contained in:
parent
27018620b7
commit
202c2304da
@ -381,6 +381,12 @@ impl ProtoError {
|
|||||||
matches!(*self.kind, ProtoErrorKind::NoConnections)
|
matches!(*self.kind, ProtoErrorKind::NoConnections)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns true if this is a std::io::Error
|
||||||
|
#[inline]
|
||||||
|
pub fn is_io(&self) -> bool {
|
||||||
|
matches!(*self.kind, ProtoErrorKind::Io(..))
|
||||||
|
}
|
||||||
|
|
||||||
pub(crate) fn as_dyn(&self) -> &(dyn std::error::Error + 'static) {
|
pub(crate) fn as_dyn(&self) -> &(dyn std::error::Error + 'static) {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
@ -264,7 +264,7 @@ where
|
|||||||
debug!("truncated response received, retrying over TCP");
|
debug!("truncated response received, retrying over TCP");
|
||||||
Ok(response)
|
Ok(response)
|
||||||
}
|
}
|
||||||
Err(e) if opts.try_tcp_on_error || e.is_no_connections() => {
|
Err(e) if opts.try_tcp_on_error || e.is_no_connections() || e.is_io() => {
|
||||||
debug!("error from UDP, retrying over TCP: {}", e);
|
debug!("error from UDP, retrying over TCP: {}", e);
|
||||||
Err(e)
|
Err(e)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user