-
Notifications
You must be signed in to change notification settings - Fork 51
fix: differentiate alarm task types #1408
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -189,8 +189,8 @@ var pdpTasks = []string{ | |
| // taskFailureCheckWith is the parameterized core shared by taskFailureCheck | ||
| // and pdpTaskFailureCheck. It alerts on final task failures over the given | ||
| // interval: any final failure in sensitiveTasks, and >5 final failures for all | ||
| // other tasks or machines. | ||
| func taskFailureCheckWith(al *alerts, name AlertName, interval time.Duration, sensitiveTasks []string) { | ||
| // other in-scope tasks or machines. | ||
| func taskFailureCheckWith(al *alerts, name AlertName, interval time.Duration, sensitiveTasks []string, inScope func(taskName string) bool) { | ||
| al.alertMap[name] = &alertOut{} | ||
|
|
||
| type taskFailure struct { | ||
|
|
@@ -231,6 +231,9 @@ func taskFailureCheckWith(al *alerts, name AlertName, interval time.Duration, se | |
| tmap := make(map[string]int) | ||
|
|
||
| for _, tf := range taskFailures { | ||
| if !inScope(tf.Name) { | ||
| continue | ||
| } | ||
| tmap[tf.Name] += tf.Failures | ||
| mmap[tf.Machine] += tf.Failures | ||
| } | ||
|
|
@@ -248,15 +251,19 @@ func taskFailureCheckWith(al *alerts, name AlertName, interval time.Duration, se | |
| } | ||
| } | ||
|
|
||
| // taskFailureCheck checks all tasks over the last FullAlertInterval. | ||
| // taskFailureCheck checks all non-PDP tasks over the last FullAlertInterval. | ||
| func taskFailureCheck(al *alerts) { | ||
| taskFailureCheckWith(al, Name_TaskFailures, FullAlertInterval, sealingTasks) | ||
| taskFailureCheckWith(al, Name_TaskFailures, FullAlertInterval, sealingTasks, func(taskName string) bool { | ||
| return !slices.Contains(pdpTasks, taskName) | ||
| }) | ||
| } | ||
|
|
||
| // pdpTaskFailureCheck checks PDP (v1 and v0) tasks over the last | ||
| // AlertMangerInterval so failures surface on every ping-health cadence. | ||
| func pdpTaskFailureCheck(al *alerts) { | ||
| taskFailureCheckWith(al, Name_PDPTaskFailures, AlertManagerInterval, pdpTasks) | ||
| taskFailureCheckWith(al, Name_PDPTaskFailures, AlertManagerInterval, pdpTasks, func(taskName string) bool { | ||
| return slices.Contains(pdpTasks, taskName) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will basically ensure that any important task not part of the array will be ignored. That's not a good choice.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There may be an inaccuracy here. But the tasks in the list all take a 5-minute route, and the rest that are not here still follow the previous 30-minute route? |
||
| }) | ||
| } | ||
|
|
||
| // permanentStorageCheck retrieves the storage details from the database and checks if there is sufficient space for sealing sectors. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will basically ensure that any important task not part of the array will be ignored. That's not a good choice.