pmdalmsensors, qa/1480: handle sensor read failures gracefully - #2689
Conversation
When sensors -j is called for a specific chip (e.g. NVMe) and the device returns EAGAIN, the empty or invalid output causes json.loads() to raise an exception, crashing the fetch callback. Catch JSON parse errors during fetch and preserve the last known sensor values instead. At init time (no chip filter), re-raise the exception so the PMDA fails loudly rather than silently starting with zero metrics. Also harden the QA test: ensure the awk sum is always numeric so _within_tolerance does not receive empty arguments. Relates: performancecopilot#2665 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Repository UI (inherited), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe PR updates PMDA numeric aggregation and changes lmsensors JSON parsing so chip-specific failures return silently while top-level failures propagate. ChangesPMDA aggregation
lmsensors parsing
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
When sensors -j is called for a specific chip (e.g. NVMe) and the device returns EAGAIN, the empty or invalid output causes json.loads() to raise an exception, crashing the fetch callback. Catch JSON parse errors during fetch and preserve the last known sensor values instead.
At init time (no chip filter), re-raise the exception so the PMDA fails loudly rather than silently starting with zero metrics.
Also harden the QA test: ensure the awk sum is always numeric so _within_tolerance does not receive empty arguments.
Relates: #2665