Better AP delivery timeout behavior
ci/woodpecker/push/ociImagePush Pipeline failed
Details
ci/woodpecker/push/ociImagePush Pipeline failed
Details
This commit is contained in:
parent
11ff0ad2c0
commit
ad253fb02b
|
@ -47,8 +47,10 @@ pub enum RetriableLocalDeliveryTaskError {
|
||||||
#[error("Retriable remote delivery error: {}")]
|
#[error("Retriable remote delivery error: {}")]
|
||||||
#[serde(tag = "type", content = "detail")]
|
#[serde(tag = "type", content = "detail")]
|
||||||
pub enum RetriableRemoteDeliveryError {
|
pub enum RetriableRemoteDeliveryError {
|
||||||
#[error("Timeout")]
|
#[error("Timeout: {0}")]
|
||||||
Timeout,
|
Timeout(String),
|
||||||
|
#[error("Timeout: {0}")]
|
||||||
|
ReqwestTimeout(String),
|
||||||
#[error("Response body too large")]
|
#[error("Response body too large")]
|
||||||
BodyLimitExceeded,
|
BodyLimitExceeded,
|
||||||
#[error("Rate limited")]
|
#[error("Rate limited")]
|
||||||
|
@ -183,7 +185,10 @@ impl From<ApClientError> for DeliveryErrorKind {
|
||||||
impl From<FederationClientError> for DeliveryErrorKind {
|
impl From<FederationClientError> for DeliveryErrorKind {
|
||||||
fn from(value: FederationClientError) -> Self {
|
fn from(value: FederationClientError) -> Self {
|
||||||
match value {
|
match value {
|
||||||
FederationClientError::TimeoutError => RetriableRemoteDeliveryError::Timeout.into(),
|
FederationClientError::TimeoutError => RetriableRemoteDeliveryError::Timeout(
|
||||||
|
"Reached maximum time for response".to_string(),
|
||||||
|
)
|
||||||
|
.into(),
|
||||||
FederationClientError::ReqwestError(e) => e.into(),
|
FederationClientError::ReqwestError(e) => e.into(),
|
||||||
FederationClientError::JsonError(e) => {
|
FederationClientError::JsonError(e) => {
|
||||||
RetriableRemoteDeliveryError::Json(e.to_string()).into()
|
RetriableRemoteDeliveryError::Json(e.to_string()).into()
|
||||||
|
@ -232,11 +237,11 @@ impl From<reqwest::Error> for DeliveryErrorKind {
|
||||||
|
|
||||||
match value {
|
match value {
|
||||||
e if e.is_connect() => RetriableRemoteDeliveryError::Connect(format!("{:?}", e)).into(),
|
e if e.is_connect() => RetriableRemoteDeliveryError::Connect(format!("{:?}", e)).into(),
|
||||||
e if e.is_timeout() => RetriableRemoteDeliveryError::Timeout.into(),
|
e if e.is_timeout() => RetriableRemoteDeliveryError::Timeout(format!("{:?}", e)).into(),
|
||||||
e if e.is_decode() => {
|
e if e.is_decode() => {
|
||||||
RetriableRemoteDeliveryError::ResponseParse(format!("{:?}", e)).into()
|
RetriableRemoteDeliveryError::ResponseParse(format!("{:?}", e)).into()
|
||||||
}
|
}
|
||||||
e if e.is_builder() => InvalidDeliveryTaskError::Reqwest(format!("{:?}", e)).into(),
|
e if e.s_builder() => InvalidDeliveryTaskError::Reqwest(format!("{:?}", e)).into(),
|
||||||
e => RetriableRemoteDeliveryError::GenericReqwest(format!("{:?}", e)).into(),
|
e => RetriableRemoteDeliveryError::GenericReqwest(format!("{:?}", e)).into(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ pub(super) fn new_federation_client_service(
|
||||||
FederationClient::new(
|
FederationClient::new(
|
||||||
true,
|
true,
|
||||||
256000,
|
256000,
|
||||||
20,
|
35,
|
||||||
UserAgent::from_str(&format!(
|
UserAgent::from_str(&format!(
|
||||||
"magnetar/{} (https://{})",
|
"magnetar/{} (https://{})",
|
||||||
config.branding.version, config.networking.host
|
config.branding.version, config.networking.host
|
||||||
|
|
Loading…
Reference in New Issue