-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add Critical Logging for Low Disk Space Condition #9617
base: master
Are you sure you want to change the base?
Conversation
Important Review skippedAuto reviews are limited to specific labels. 🏷️ Labels to auto review (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Logging with |
I realized I’d misunderstood the issue initially and have swapped Criticalf for Errorf, which seems better suited for managing these errors without escalating them to critical status. With this change, the node now logs a warning when available disk space drops below a threshold—say, 5%—and only shuts down if it falls below the required minimum. On top of that, I’ve taken a stab at addressing the file descriptor concern raised in #6693. I’ve added a new file to check for available file descriptors, with the program exiting if none are free. This should help catch the problem early and keep things stable. @guggero, whenever you’ve got a moment, I’d appreciate your take on this—especially if you think my approach misses the mark or could be improved. Let me know what you think. Thank you |
I'll take a look some time next week. In the meantime, please take a look at https://github.com/lightningnetwork/lnd/blob/master/docs/code_contribution_guidelines.md and https://github.com/lightningnetwork/lnd/blob/master/docs/code_formatting_rules.md. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello! Let’s start from the beginning 😉. Please take a moment to read the contribution guidelines:
https://github.com/lightningnetwork/lnd/blob/master/docs/code_contribution_guidelines.md#model-git-commit-messages
https://github.com/lightningnetwork/lnd/blob/master/docs/code_contribution_guidelines.md#ideal-git-commit-structure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some points to consider for your PR:
- The
defaultRequiredDisk
is already defined in config.go, so there's no need to redefine another threshold. - The log regarding small free disk space already exists, so there’s no need to log it again.
- Checking file descriptor availability could be a good addition, but the log should be triggered before the resource is fully exhausted, not when there are no file descriptors left.
@arnav-makkar, the PR should be submitted as a final version ready for review. Currently, the code isn’t compiling and needs to be fixed before it can be properly reviewed. Keep up the good work! 😉 |
Hi @MPins, |
hey @arnav-makkar I'm currently reviewing your PR, and to get a deeper understanding of your changes, I checked out your fork and attempted to build the code locally. |
Change Description
Fixes #6693
This PR enhances disk space monitoring by introducing critical logging when free disk space drops below 5% ensuring timely alerts for potential storage issues.
Changes Introduced:
For example, if only 4% of disk space is available, the log will output:
CRITICAL: Disk space critically low: 4.0% free space remaining
Why This Change?
Testing & Verification:
This is my first open-source PR, and I'm excited to contribute! Feedback is welcome. 🚀