fix(input.temp): Ignore EAGAIN on unavailable thermal-zones#18913
fix(input.temp): Ignore EAGAIN on unavailable thermal-zones#1891301110111000001 wants to merge 1 commit into
Conversation
5ff01fc to
fd277f6
Compare
|
The integration tests failed at plugins/outputs/graphite/graphite_test.go:636, not sure why as I did not touch that file and the test does not seem to rely on the inputs.temp plugin. Tell me if should do anything to correct that! |
srebhan
left a comment
There was a problem hiding this comment.
Thanks @01110111000001! Just one question about the content length...
fd277f6 to
57729fe
Compare
|
Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
|
@srebhan I rebased my branch on top of the new master branch state so the comparison shows many changes. I modified the comment to be more descriptive as well as the test case to clearly show only the first 8 bytes are read. Thanks for your reviews! |
Summary
When the hardware device is sleeping, the temp input plugin completely hangs waiting for the os.ReadFile call to return.
The EAGAIN returned by the kernel is handled internally by os.ReadFile and the function waits for the file to become available.
-> Open the file in non-blocking mode and silently ignoring unavailable thermal-zones.
Some comments/potential issues
Looking forward to your feedback and your thoughts on the potential issues.
Thanks for your great work on this tool!
Checklist
AI was used to generate a first version (heavily modified since) of the newly added unit test for the readFileAsync function.
Related issues
resolves #18899