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)
|
||||
}
|
||||
|
||||
/// 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) {
|
||||
self
|
||||
}
|
||||
|
|
|
@ -264,7 +264,7 @@ where
|
|||
debug!("truncated response received, retrying over TCP");
|
||||
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);
|
||||
Err(e)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user