Skip to content

Commit

Permalink
Fix ledger distribution resync (#4013)
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-mobilecoin authored Oct 24, 2024
1 parent d2aa66b commit 1b837c3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ledger/distribution/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ use mc_ledger_db::{Ledger, LedgerDB};
use mc_util_telemetry::{mark_span_as_active, start_block_span, tracer, Tracer};
use protobuf::Message;
use retry::{delay, retry, OperationResult};
use rusoto_core::{Region, RusotoError};
use rusoto_s3::{HeadObjectError, HeadObjectRequest, PutObjectRequest, S3Client, S3};
use rusoto_core::{request::BufferedHttpResponse, Region, RusotoError};
use rusoto_s3::{HeadObjectRequest, PutObjectRequest, S3Client, S3};
use serde::{Deserialize, Serialize};
use std::{fs, path::PathBuf};
use tokio::runtime::Handle;
Expand Down Expand Up @@ -209,7 +209,11 @@ impl BlockHandler for S3BlockWriter {
let result = runtime.block_on(self.s3_client.head_object(req));
match result {
Ok(_) => OperationResult::Ok(true),
Err(RusotoError::Service(HeadObjectError::NoSuchKey(_))) => {
// Happens when the object doesn't exist, see
// https://docs.aws.amazon.com/cli/latest/reference/s3api/head-object.html
Err(RusotoError::Unknown(BufferedHttpResponse { status, .. }))
if status.as_u16() == 404 =>
{
OperationResult::Ok(false)
}
Err(e) => {
Expand Down

0 comments on commit 1b837c3

Please sign in to comment.