Skip to content

Commit

Permalink
fix(object_store): fix sdk error downcast (#16743)
Browse files Browse the repository at this point in the history
  • Loading branch information
Li0k authored May 14, 2024
1 parent ff49514 commit c1cc535
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/object_store/src/object/s3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1006,18 +1006,19 @@ where
} => {
let sdk_err = inner
.as_ref()
.downcast_ref::<SdkError<E, aws_smithy_runtime_api::http::Response<SdkBody>>>()
.unwrap();
.downcast_ref::<SdkError<E, aws_smithy_runtime_api::http::Response<SdkBody>>>();

let err_should_retry = match sdk_err {
SdkError::DispatchFailure(e) => {
Some(SdkError::DispatchFailure(e)) => {
if e.is_timeout() {
tracing::warn!(target: "http_timeout_retry", "{e:?} occurs, retry S3 get_object request.");
true
} else {
false
}
}
SdkError::ServiceError(e) => {

Some(SdkError::ServiceError(e)) => {
let retry = match e.err().code() {
None => {
if config.s3.developer.object_store_retry_unknown_service_error
Expand Down Expand Up @@ -1048,7 +1049,7 @@ where
retry
}

SdkError::TimeoutError(_err) => true,
Some(SdkError::TimeoutError(_err)) => true,

_ => false,
};
Expand Down

0 comments on commit c1cc535

Please sign in to comment.