Files
nezha_domains/model
naiba 0759f5c801 fix(alert): prevent divide-by-zero panic and unbounded growth on zero-duration rule
A general alert rule with Duration:0 (accepted by the API, no minimum
validation) drove fail*100/total with total==0, panicking with an integer
divide-by-zero inside checkStatus, which has no recover and would take down the
whole alert goroutine — a config-reachable DoS by any user able to create alert
rules. Skip duration<=0 rules in Check via continue (not boundCheck, which would
pollute hasPassedRule and skip sibling valid rules). Also trim the sample slice
when max<=0 in alertsentinel, otherwise it appended every tick without ever
trimming. Adds regression tests for zero-only and mixed rule sets.
2026-06-05 02:42:49 +00:00
..
2024-12-19 23:21:15 +08:00
2024-12-28 23:50:59 +08:00
2024-11-16 20:57:03 +08:00
2025-04-26 18:28:21 +08:00
2024-10-25 09:09:08 +08:00
2024-12-04 20:00:18 +08:00
2025-01-21 22:23:15 +08:00
2024-11-16 20:57:03 +08:00
2024-10-20 00:32:55 +08:00
2025-03-19 22:21:21 +08:00
2024-11-16 20:57:03 +08:00
2024-10-21 23:00:51 +08:00
2026-02-15 13:13:33 +08:00
2024-10-22 22:01:01 +08:00
2024-11-16 20:57:03 +08:00