Skip to content

sysfs: skip cooling devices whose attributes return ENODATA - #886

Merged
SuperQ merged 2 commits into
prometheus:masterfrom
jlapenna:fix/cooling-device-enodata-0309-01a132ab
Oct 19, 2026
Merged

SuperQ merged 2 commits into
prometheus:masterfrom
jlapenna:fix/cooling-device-enodata-0309-01a132ab

Conversation

@jlapenna

@jlapenna jlapenna commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

A cooling-device attribute returning ENODATA currently fails the whole thermal collection. Add errors.Is(err, syscall.ENODATA) to the shared sysfs canIgnoreError policy so callers can skip unavailable entries. Other I/O and parse errors still propagate.

The maintainer follow-up removes the parser-function indirection from cooling-device collection and restores its direct parser call. Regression cases exercise the shared predicate with direct, os.PathError and further wrapped ENODATA, plus EIO, parse and existing ignorable errors. The original cooling-device fixture remains.

Validation at exact 510cc3de5d5de8cba90d697a10f21635dc73bb10: the old shared predicate fails all three ENODATA cases; corrected focused tests and normal make test (go test -race -p=1 ./...) pass in all 13 test-bearing packages. Affected-package make lint pkgs=./sysfs reports zero issues; make style, make check_license, fixture setup and unchanged fixtures.ttar checks pass. Normal signed-off commit and forward push completed. Current upstream CI and maintainer review remain separate gates.

Related: jlapenna/homelab#2631. This change does not deploy a node-exporter package.

Signed-off-by: Joe LaPenna <jlapenna@gmail.com>
Comment thread sysfs/class_cooling_device.go Resolved
Comment thread sysfs/class_cooling_device.go Resolved
Signed-off-by: Joe LaPenna <jlapenna@gmail.com>
@jlapenna

Copy link
Copy Markdown
Contributor Author

@SuperQ both review points are addressed in 510cc3d:

  • ENODATA is now handled in the shared canIgnoreError() policy, as you suggested.
  • The test-only parser indirection is gone; cooling-device collection calls its parser directly again.

Both threads are resolved. Could you take another look when you have a moment?

@SuperQ SuperQ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@SuperQ
SuperQ merged commit ba3fc92 into prometheus:master Oct 19, 2026
7 checks passed
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.

2 participants