Repository navigation
fix(notify): don't re-notify a past-only SMART failure when its value moves - #1144
Closed
RyoKusnadi wants to merge 1 commit into
Closed
RyoKusnadi wants to merge 1 commit into
RyoKusnadi wants to merge 1 commit into
Conversation
… moves With repeat notifications off, an ATA attribute whose only problem is when_failed "past" notified on every run because attributes like 190 (100 minus temperature) change value between runs. Skip the value-change check for such attributes; a new or escalated status still notifies. Signed-off-by: Ryo Kusnadi <ryokusnadi@gmail.com>
Author
|
Closing this one, sorry for the noise. |
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.
Summary
With repeat notifications off, a drive whose only problem is a
when_failed: "past"attribute still sends a SMART notification on every collector run. It now notifies once, when the attribute first shows up.How it happens: attribute 190 (
Airflow_Temperature_Cel) is 100 minus the temperature, so its value moves a point or two between runs.pastbecomes aWarningScrutinystatus (since #1126), which qualifies at notify level Warn.hasQualifyingFailurethen sees "same status, different value" and calls it a change, every time.Steps to reproduce: Warn level, Repeat off, a drive with attribute 190
when_failed: "past". Submit twice with the value going 72 then 71.Expected: one notification. Actual: one per submission.
Cause:
hasQualifyingFailureinnotify.gocompares the evaluated value. For apastmark the value says nothing about the drive's state.Type of Change
Related Issues
Fixes #1143 (the "notify once" outcome it lists as expected). Whether
pastshould notify at all is left open.Changes Made
smart_ata_attribute.go: newFailedOnlyInThePast(), true whenpastis the attribute's only status and only reason.notify.go: skip the value comparison for such an attribute. A new or escalated status still notifies, and an attribute with its own warning keeps the value check.Scope: a value-based warning on a moving attribute (like temperature) can still re-notify; that is existing behaviour and left alone. The same applies to the
betabranch (#1129), which gets this through the next sync.Testing
New:
TestShouldNotify_NoRepeat_AtaPastFailureValueMovesIsNotChangeand..._AtaPastFailureWithOtherWarningValueChanged. Before the fix the first one fails ("Should be false"); after, both pass.Run:
go vetandgo teston./pkg/notify/ ./pkg/models/measurements/ ./pkg/web/handler/.TestScriptStreamsOutputAndPreservesEnvironmentfails on my Mac (same as noted in #1126); the rest pass. Not run: full suite, a real drive. golangci-lint can't load the repo (vendor/modules.txt out of sync), so it was skipped.Environment: fix/skip-value-change-for-past-failures @ e1900f7, go1.27.1, darwin/arm64
Checklist