Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions accounts-db/src/tiered_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use {
solana_sdk::account::ReadableAccount,
std::{
borrow::Borrow,
fs,
fs, io,
path::{Path, PathBuf},
sync::{
atomic::{AtomicBool, Ordering},
Expand Down Expand Up @@ -65,10 +65,14 @@ pub struct TieredStorage {
impl Drop for TieredStorage {
fn drop(&mut self) {
if let Err(err) = fs::remove_file(&self.path) {
panic!(
"TieredStorage failed to remove backing storage file '{}': {err}",
self.path.display(),
);
// Here we bypass NotFound error as the focus of the panic is to
// detect any leakage of storage resource.
if err.kind() != io::ErrorKind::NotFound {
panic!(
"TieredStorage failed to remove backing storage file '{}': {err}",
self.path.display(),
);
}
}
}
}
Expand Down