Skip to content

Commit

Permalink
v1.16: Add logging to move_and_async_delete_path (backport of #32017) (
Browse files Browse the repository at this point in the history
…#32019)

Add logging to move_and_async_delete_path (#32017)

(cherry picked from commit ddbc35f)

Co-authored-by: Brooks <[email protected]>
  • Loading branch information
mergify[bot] and brooksprumo authored Jun 8, 2023
1 parent 5cdbfc5 commit 124aaa9
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions runtime/src/snapshot_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 124aaa9

Please sign in to comment.