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
sensors module fix #4651
sensors module fix #4651
Conversation
Wait, so the If so, that should be reported upstream as a bug (or we should update if it's fixed upstream), nothing should ever raise |
it raises nothing except bare netdata uses this |
@Ferroin 😄 |
I guess I'll be submitting a PR to that then to add a local Exception sub-class for it to throw... Short term, this is fine, but we really should not be catching a bare exception and blindly ignoring it. |
PR created upstream to add something saner for us to catch: paroj/sensors.py#2 Hopefully the author is still around, it's been 8 months since the last commit. |
Author is very active on github, i am sure it will respond soon. How about to mirror C code errors btw? like this is our get_value error codes Implementation: ERR_WILDCARDS = 1
ERR_NO_ENTRY = 2
class SensorsError(Exception):
pass
class ErrorWildcards(SensorsError):
pass
class ErrorNoEntry(SensorsError):
pass
...
def is_error(idx):
return idx < 0
def error_factory(idx):
idx = abs(idx)
if idx == ERR_WILDCARDS:
return ErrorWildcards
elif idx == ERR_NO_ENTRY:
return ErrorNoEntry
...
err = _hdl.sensors_parse_chip_name(orig_name.encode("utf-8"), byref(ret))
if is_error(err):
raise error_factory(err)(strerror(err)) ? |
I was just trying for something quick to make sure it was usable. I'll probably post an update to it to mirror C errors, but that will probably have to wait until tomorrow. |
merge? |
@Ferroin upstream is fixed, do you have time to update netdata's lm_sensors and sensors module? |
Yes, I'll have a PR to do so later today. |
* sensors: survive sensors.get_value Exception * sensors: log unreadable subfeature in check * sensors: add todos
Summary
Fix: #4602
Component Name
python module
sensors
Additional Information
bug trace:
quick fix:
skip unreadable values
@hznovich please test the fix
Module is small but extremely hard to read.