fix(doctor): use live open-fd counts for accurate fd exhaustion eta #115#202
Open
Rakshak05 wants to merge 3 commits into
Open
fix(doctor): use live open-fd counts for accurate fd exhaustion eta #115#202Rakshak05 wants to merge 3 commits into
Rakshak05 wants to merge 3 commits into
Conversation
|
🚀 First PR — welcome aboard! A few things to expect:
If you get stuck, reply here or jump to Discussions. We want this PR to land. |
Signed-off-by: Rakshak05 <rakshakbarkur@gmail.com>
Signed-off-by: Rakshak05 <rakshakbarkur@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #115
What
This PR fixes file descriptor exhaustion ETA estimations by collecting and utilizing the actual live open file descriptor count and soft limits from
/proc/<pid>/fdand/proc/<pid>/limitsfor top leaking processes rather than system-wide window net deltas.How
FDEntryandFDSnapshotmodels to include live FD counts and limit fields, and populated them inSnapshot()for the top 5 net-delta processes./procparsing helpers (CountProcFDsandReadProcFDLimit) that utilize a mockable package-level base path to ensure tests can run reliably on non-Linux platforms.fdHeadroomfunction to calculate exact remaining headroom with prioritized fallback strategies when/procmetrics are unavailable.evalFDLeakandpredictFDExhaustionto usefdHeadroom, appending a clear "(estimated from window delta — actual may be lower)" warning to the impact string when the live count cannot be measured.Testing
go build ./...passesgo test ./...passesgo vet ./...passesgolangci-lint run ./...passes/procstructures and rules/predict engines.sudo ./bin/bpf-verify --read 5sconfirms 6/6 programs still load./scripts/verify.shpasses (or specific phase:./scripts/verify.sh quality)Checklist
feat(scope): subject)git commit -s)scripts/verify.sh