mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-26 05:21:00 +00:00
rusoto: s3sink, s3src: Retry on server errors
We can retry in the case of 500/503/other errors that might occur that might be recoverable, instead of bailing.
This commit is contained in:
parent
a3db85d869
commit
e973d41bac
1 changed files with 15 additions and 1 deletions
|
@ -9,7 +9,7 @@
|
|||
use bytes::{buf::BufMut, Bytes, BytesMut};
|
||||
use futures::{future, Future, FutureExt, TryFutureExt, TryStreamExt};
|
||||
use once_cell::sync::Lazy;
|
||||
use rusoto_core::RusotoError::HttpDispatch;
|
||||
use rusoto_core::RusotoError::{HttpDispatch, Unknown};
|
||||
use rusoto_core::{ByteStream, HttpDispatchError, RusotoError};
|
||||
use std::sync::Mutex;
|
||||
use std::time::Duration;
|
||||
|
@ -78,6 +78,20 @@ where
|
|||
gst::warning!(CAT, "Error waiting for operation ({:?}), retrying", err);
|
||||
backoff::Error::transient(err)
|
||||
}
|
||||
Unknown(ref response) => {
|
||||
gst::warning!(
|
||||
CAT,
|
||||
"Unknown error waiting for operation ({:?}), retrying",
|
||||
response
|
||||
);
|
||||
|
||||
// Retry on 5xx errors
|
||||
if response.status.is_server_error() {
|
||||
backoff::Error::transient(err)
|
||||
} else {
|
||||
backoff::Error::permanent(err)
|
||||
}
|
||||
}
|
||||
_ => backoff::Error::permanent(err),
|
||||
})
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue