Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaces fs-err in remove_tmp_snapshot_archives() #34839

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

brooksprumo
Copy link
Contributor

@brooksprumo brooksprumo commented Jan 18, 2024

Problem

The fs-err create does not include source errors when displaying the error. The solana repo's convention is to include the source error in the message, so we end up losing the underlying cause of an IO error if fs_err is used.

Here's more info about the issue that I raised on the fs-err repo: andrewhickman/fs-err#51. Turns out their behavior is desired, and likely the most idiomatically correct Rust way. But we're not going to change the solana repo's error reporting anytime soon. Instead, we should replace the use of fs-err with regular std::fs.

Related: #34799

Summary of Changes

Replace fs-err in remove_tmp_snapshot_archives()

@brooksprumo brooksprumo self-assigned this Jan 18, 2024
@brooksprumo brooksprumo changed the title Removes fs-err for remove_tmp_snapshot_archives() Replaces fs-err in remove_tmp_snapshot_archives() Jan 18, 2024
@brooksprumo brooksprumo marked this pull request as ready for review January 18, 2024 20:29
@brooksprumo brooksprumo requested a review from steviez January 18, 2024 20:29
Copy link

codecov bot commented Jan 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (8f9d915) 81.8% compared to head (a1c706a) 81.7%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##           master   #34839     +/-   ##
=========================================
- Coverage    81.8%    81.7%   -0.1%     
=========================================
  Files         825      825             
  Lines      223269   223269             
=========================================
- Hits       182635   182619     -16     
- Misses      40634    40650     +16     

Copy link
Contributor

@steviez steviez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and interesting note that we're not following general convention.

While the cascading sources (if there are multiple layers of error on the bubble up) can make things verbose, having that extra information is definitely valuable. And agreed on no massive overhauls in the short term

@brooksprumo brooksprumo merged commit 3388507 into solana-labs:master Jan 18, 2024
35 checks passed
@brooksprumo brooksprumo deleted the snap/errors/remove-tmp branch January 18, 2024 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants