-
Notifications
You must be signed in to change notification settings - Fork 781
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: correct datadir disk usage reporting in lighthouse.rs #6741
base: stable
Are you sure you want to change the base?
Conversation
Fix disk usage metrics to show datadir usage instead of root
This should not require the addition of a new environment variable. Lighthouse already knows the data directory from the |
@michaelsproul this one seems to be better |
That doesn't work @crStiv. Are you writing this PR with AI? |
Made an update, this one should be alright. I used chatgpt to help me create a pull request description |
common/eth2/src/lighthouse.rs
Outdated
/// Gets the datadir which should be used. | ||
fn get_data_dir() -> PathBuf { | ||
// Try to get datadir from command line arguments | ||
let args: Vec<String> = std::env::args().collect(); |
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.
We shouldn't be re-parsing the CLI args like this. They are already parsed by clap and available in the config
Fix datadir disk usage reporting in lighthouse.rs
Description
This pull request updates
lighthouse.rs
to fix the disk usage metrics. Previously, the disk usage was calculated for the root directory (/
). The new implementation correctly retrieves and uses theLIGHTHOUSE_DATADIR
environment variable to calculate disk usage for the appropriate data directory. If the environment variable is not set, it defaults to/
.Fixes #6687
Proposed Changes
disk_usage
calculation to use theLIGHTHOUSE_DATADIR
environment variable.LIGHTHOUSE_DATADIR
is not specified.Additional Info
LIGHTHOUSE_DATADIR
environment variable. Reviewers should ensure the variable is correctly set in environments where this change is deployed.LIGHTHOUSE_DATADIR
is missing or set to invalid paths.Allow edits by maintainers
Yes.
Please ensure contributions adhere to the repository's contributing guidelines and security policy.