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

Fix possibly unhandled exception in disk monitor #1458

Merged

Conversation

dominiklohmann
Copy link
Member

@dominiklohmann dominiklohmann commented Mar 17, 2021

📔 Description

This make recursive_size return an error instead of throw a (then unhandled) exception. The underlying root cause will need to be eliminated in a separate PR—it's not that simple to fix.

📝 Checklist

  • All user-facing changes have changelog entries.
  • The changes are reflected on docs.tenzir.com/vast, if necessary.
  • The PR description contains instructions for the reviewer, if necessary.

🎯 Review Instructions

File-by-file.

@dominiklohmann dominiklohmann added the bug Incorrect behavior label Mar 17, 2021
@dominiklohmann dominiklohmann requested a review from a team March 17, 2021 10:09
Copy link
Member

@mavam mavam left a comment

Choose a reason for hiding this comment

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

Looks good.

I would reduce the scope of the extra comment, though.

@dominiklohmann dominiklohmann force-pushed the story/ch23831/fix-disk-monitor-unhandled-exception branch from 639f24b to c13dae7 Compare March 17, 2021 10:13
Copy link
Member

@mavam mavam left a comment

Choose a reason for hiding this comment

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

No further testing needed here, assuming we exhaustively covered all call sites of file_size.

@dominiklohmann dominiklohmann requested a review from tobim March 17, 2021 12:00
Copy link
Member

@tobim tobim left a comment

Choose a reason for hiding this comment

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

Leaving the rest to CI.

@dominiklohmann dominiklohmann force-pushed the story/ch23831/fix-disk-monitor-unhandled-exception branch from 1dc8881 to 33dcc05 Compare March 17, 2021 12:31
@dominiklohmann dominiklohmann merged commit 1e9ee5e into master Mar 17, 2021
@dominiklohmann dominiklohmann deleted the story/ch23831/fix-disk-monitor-unhandled-exception branch March 17, 2021 13:26
@@ -36,7 +36,12 @@ recursive_size(const std::filesystem::path& root_dir) {
return caf::make_error(ec::filesystem_error, err.message());
for (const auto& f : dir) {
if (f.is_regular_file()) {
const auto size = f.file_size();
const auto size = f.file_size(err);
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry about this bug. My fault 😞

Copy link
Member Author

Choose a reason for hiding this comment

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

No worries, we missed it during review. Your PRs are super appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants