Skip to content

Commit

Permalink
Fix wrong log messaging while removing file in FilesystemStore
Browse files Browse the repository at this point in the history
In `EncodedFilePath`'s `drop()` function, it was logging "File deleted"
message even though the file wasn't deleted yet. That is currently fixed
by logging that message when the file has been successfully deleted.
  • Loading branch information
aleksdmladenovic committed Nov 12, 2024
1 parent 798e4fe commit 1284319
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nativelink-store/src/filesystem_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,13 @@ impl Drop for EncodedFilePath {
.active_drop_spawns
.fetch_add(1, Ordering::Relaxed);
background_spawn!("filesystem_delete_file", async move {
event!(Level::INFO, ?file_path, "File deleted",);
let result = fs::remove_file(&file_path)
.await
.err_tip(|| format!("Failed to remove file {file_path:?}"));
if let Err(err) = result {
event!(Level::ERROR, ?file_path, ?err, "Failed to delete file",);
} else {
event!(Level::INFO, ?file_path, "File deleted",);
}
shared_context
.active_drop_spawns
Expand Down

0 comments on commit 1284319

Please sign in to comment.