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

Added free space check for healthchecks and node shutdown when free s… #4837

Merged

Conversation

damian-orzechowski
Copy link
Contributor

@damian-orzechowski damian-orzechowski commented Oct 28, 2022

…pace falls below a configurable threshold.

Resolves #4325

Changes:

  • Added free disk space checks for drive configured as DB location. There are 2 configurable thresholds added:
    • LowStorageSpaceWarningThreshold - percentage of free disk space below which a warning is added to the console as well as to the HealthChecks. Default value is 5%.
    • LowStorageSpaceShutdownThreshold - percentage of fee disk space below which node will shutdown. Default value is 1%.

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Other (please describe):

Testing

Requires testing

  • Yes
  • No

In case you checked yes, did you write tests??

  • Yes
  • No

Further comments (optional)

Tested on Windows, Ubuntu (VM and WSL) and Docker
For Docker, please note that when data folder is not mapped to an external volume, drive information will reflect the size of the virtual drive, which may not correspond to physical space.

@damian-orzechowski damian-orzechowski marked this pull request as ready for review November 7, 2022 08:29
Copy link
Member

@LukaszRozmej LukaszRozmej left a comment

Choose a reason for hiding this comment

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

I think all this messagebus and friends can be simplified with simple Environment.Exit

Copy link
Member

@LukaszRozmej LukaszRozmej left a comment

Choose a reason for hiding this comment

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

Will 1% be enough on average disk to close the node and save all state?

@damian-orzechowski damian-orzechowski merged commit 401d77c into master Dec 16, 2022
@damian-orzechowski damian-orzechowski deleted the feature/4325_shutdown_with_warning_when_disk_space_low branch December 16, 2022 09:07
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.

Shutdown with warning when disk space is low
3 participants