Add logging to move_and_async_delete_path (#32017)

This commit is contained in:
Brooks 2023-06-07 16:31:16 -04:00 committed by GitHub
parent 36ccc71220
commit ddbc35fcc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 2 deletions

View File

@ -512,9 +512,22 @@ pub fn move_and_async_delete_path(path: impl AsRef<Path>) {
Builder::new()
.name("solDeletePath".to_string())
.spawn(move || {
std::fs::remove_dir_all(path_delete).unwrap();
trace!("background deleting {}...", path_delete.display());
let (_, measure_delete) = measure!(std::fs::remove_dir_all(&path_delete)
.map_err(|err| {
SnapshotError::IoWithSourceAndFile(
err,
"background remove_dir_all",
path_delete.clone(),
)
})
.expect("background delete"));
trace!(
"background deleting {}... Done, and{measure_delete}",
path_delete.display()
);
})
.unwrap();
.expect("spawn background delete thread");
}
/// The account snapshot directories under <account_path>/snapshot/<slot> contain account files hardlinked