fix(inputs.lustre2): getLustreProcStats skips empty files (#16911)

Co-authored-by: Alexandre Van Kempen <alexandre.vankempen@qarnot-computing.com>
This commit is contained in:
alexvkempen 2025-04-30 18:15:15 +02:00 committed by GitHub
parent 81d9937cde
commit 26e1f35524
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

View File

@ -242,6 +242,11 @@ func (l *Lustre2) getLustreProcStats(fileglob string, wantedFields []*mapping) e
if err != nil {
return err
}
if len(wholeFile) == 0 {
l.Log.Debugf("Skipping empty file %s", file)
continue
}
jobs := strings.Split(string(wholeFile), "- ")
for _, job := range jobs {
lines := strings.Split(job, "\n")