Defensively format errors in traces to avoid deadlocks

This commit is contained in:
asonix 2022-09-25 18:46:26 -05:00
parent 890478e794
commit 51d8621015
2 changed files with 4 additions and 5 deletions

View file

@ -6,7 +6,6 @@ use crate::{
store::{Identifier, Store},
};
use futures_util::StreamExt;
use tracing::error;
pub(super) fn perform<'a, R, S>(
repo: &'a R,
@ -39,7 +38,7 @@ where
Cleanup::AllVariants => all_variants::<R, S>(repo).await?,
},
Err(e) => {
tracing::warn!("Invalid job: {}", e);
tracing::warn!("Invalid job: {}", format!("{}", e));
}
}
@ -69,7 +68,7 @@ where
let span = tracing::error_span!("Error deleting files");
span.in_scope(|| {
for error in errors {
error!("{}", error);
tracing::error!("{}", format!("{}" error));
}
});
}

View file

@ -58,7 +58,7 @@ where
}
},
Err(e) => {
tracing::warn!("Invalid job: {}", e);
tracing::warn!("Invalid job: {}", format!("{}", e));
}
}
@ -113,7 +113,7 @@ where
result
}
Err(e) => {
tracing::warn!("Failed to ingest {}, {:?}", e, e);
tracing::warn!("Failed to ingest {}, {}", format!("{}", e), format!("{:?}", e));
UploadResult::Failure {
message: e.to_string(),