Add timestamp to the leak sensor data in DB, Fix to not escalate a minor leak if platform doesn't support it#853
Merged
Conversation
…nor leak if platform doesn't support it
|
LGTM. |
Contributor
Author
sure let me check @Yakiv-Huryk |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Yakiv-Huryk
approved these changes
Jul 9, 2026
yxieca
approved these changes
Jul 10, 2026
yxieca
left a comment
There was a problem hiding this comment.
AI-assisted review — Approve
Reviewed the thermalctld leak-sensor changes:
- Escalation fix (
if 0 < max_minor_secs < inf): aget_leak_max_minor_duration_sec()of 0/negative now correctly means "platform does not support time-based MINOR→CRITICAL escalation" instead of escalating immediately. Fixes sonic-buildimage#28218. leak_severityDB value now written assensor_leak_severity.value('MINOR'/'CRITICAL') with a'None'fallback, instead ofstr(enum)which produced'LeakSeverity.MINOR'. Applied consistently at all severity-write sites.timestampadded to the sensor-table write but deliberately excluded from thefvs_tuplediff-cache, so the advancing clock doesn't defeat change-detection and rewrite the row every poll.
Test coverage is solid — the no-escalation-when-duration-zero case, timestamp-on-transitions-only, and timestamp-not-in-diff-cache behaviors are all explicitly verified.
Looks good.
AI-assisted review, reviewed and approved by Ying Xie (@yxieca).
Collaborator
|
Cherry-pick PR to msft-202608: Azure/sonic-platform-daemons.msft#73 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Couple of enhancements/fixes in this PR
Add timestamp to the leak sensor data in DB
Fix to not escalate a minor leak if platform doesn't support it
Fixes Bug: BMC leak escalation logic is not aligned with the HLD sonic-buildimage#28218
Also update the leak_severity in sensor table to in DB correctly as 'CRITICAL' 'MINOR' and 'None' strings
Motivation and Context
If the platform doesn't support escalation of a minor leak --> critical Skip it by checking the return value of platform API is 0
Add timestamp to sensor leak data entry in sensor table -- This will help triage when the leak started.
How Has This Been Tested?
Unit tests added which mock the leak conditions and test
Additional Information (Optional)