unbridled-41 opened a new pull request, #4657:
URL: https://github.com/apache/rocketmq-dashboard/pull/4657
Fixes #4653.
## Problem / Evidence
When an alert-notification delivery exhausts its retry attempts
(`NotificationOutboxService.MAX_ATTEMPTS = 5`), the audit row is written with
result `"FAILURE"`:
-
`server/src/main/java/org/apache/rocketmq/studio/ops/alert/NotificationOutboxService.java:519-521`
(the `retry(...)` helper, exhausted branch);
- the shared audit vocabulary is `SUCCESS`/`FAILED`/`PARTIAL`
(`OperationAuditConstants.Result`), and `MybatisPlusAuditRepository.summarize`
builds its `failed` bucket with `getOrDefault("FAILED", 0L)`
(`MybatisPlusAuditRepository.java:124-133`);
- consequence 1: a `FAILURE` row counts toward the summary `total` but lands
in none of the three buckets, so the audit summary cards never add up and the
failed count permanently misses notification-delivery failures;
- consequence 2: the web audit page derives its result-filter options from
the distinct `result` values in the data, so `FAILED` and `FAILURE` both render
as "Failed" and select different row sets.
Red regression (new
`auditsAnExhaustedDeliveryWithTheSharedFailedVocabularyTest`): an attempt at
`MAX_ATTEMPTS` that the DingTalk robot rejects must audit `record(...,
"FAILED", ...)`. On unmodified master it fails with the recorded value
`"FAILURE"`.
## Root cause / Fix
The exhausted-delivery audit call simply used a result string outside the
vocabulary everyone else shares (DLQ resend uses
`SUCCESS`/`FAILED`/`PARTIAL`/`NO_MESSAGES`; direct consume writes `FAILED`; the
admin-client paths write `FAILED`). The one-off value silently fell outside
every aggregation.
Fix: record exhausted deliveries as `"FAILED"`. The non-exhausted
`"RETRYING"` rows keep their existing semantics (they mark an in-progress
retry, not a terminal failure).
## Priority & scoring
PRIORITY = 影响 30(审计汇总/过滤器是合规与排障的读面,通知投递失败被永久漏计)+ 波及 14(审计 summary
卡片、结果过滤器两个消费面)+ 可复现 18(确定性,一次失败的投递即触发)+ 维护价值 16(词表统一)= **78**。FIX_CONFIDENCE =
**95**(单值替换,全部行为可由现有审计测试表达)。
## Tests
- New regression:
`NotificationOutboxServiceTest#auditsAnExhaustedDeliveryWithTheSharedFailedVocabularyTest`.
- Red on master: `Tests run: 1, Failures: 1` — Mockito recorded
`record("FAIL_ALERT_NOTIFICATION", ..., "FAILURE", ...)` while the test
requires `"FAILED"`.
- Green after the fix.
- Module: `mvn -o -Dtest='NotificationOutboxServiceTest' test` → `Tests run:
26, Failures: 0, Errors: 0` (25 pre-existing + 1 new).
- Full backend suite (this branch): `SPRING_PROFILES_ACTIVE=dev mvn -o test`
→ `Tests run: 2415, Failures: 0, Errors: 0, Skipped: 0`, `BUILD SUCCESS`
(pristine master baseline on this machine: 2414 passing + 1 new test here =
2415).
- Checkstyle: `mvn -o checkstyle:check` → clean.
- Backend package: `mvn -o -DskipTests package` → `BUILD SUCCESS`,
`target/rocketmq-studio-1.0.0.jar` produced.
## Risk
Minimal. The only behavioral change is the `result` string of
`FAIL_ALERT_NOTIFICATION` audit rows, which is exactly what the audit
aggregations and the web filter already expect. Existing audit rows stored with
`FAILURE` keep rendering (the web presentation maps `FAILURE` → "Failed"
already); only their historical contribution to the summary bucket remains
zero, which is a data limitation, not a code one.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]