unbridled-41 opened a new pull request, #4871:
URL: https://github.com/apache/rocketmq-dashboard/pull/4871

   ## Problem / Evidence
   
   `MybatisPlusAlertRepository.readLabels` (and the same helper in 
`MybatisPlusAlertStateRepository`) throws `IllegalStateException` when a row's 
`labels_json` column does not parse. Because `findAlertsPage` maps every row of 
the page through `toAlertVO`:
   
   - `GET /api/system-alerts/page` (and the legacy `/api/system-alerts`) fails 
with a 500 as long as the corrupt row is in the result set — the list endpoint 
is permanently broken until the row is fixed by hand.
   - `AlertNotificationSuppressionService.findSuppressingClusterAlert` pages 
the same query inside every BUSINESS-domain FIRING/REMINDER evaluation, so one 
corrupt row aborts every business-rule evaluation of the native alerting 
pipeline (`NativeAlertProcessor` only counts and logs the failure) — 
notifications silently stop.
   
   The row-level failure is escalated to a query-level failure even though 
`labels` is an optional, externally mutable TEXT column. The codebase's own 
convention for unreadable persisted payloads is skip/degrade (e.g. 
`AiConversationService.decode`).
   
   Reproduced by a regression test: a page containing one healthy row 
(`{"cluster":"demo"}`) and one corrupt row (`{not-json`) threw 
`IllegalStateException: Unable to read alert labels` before the fix.
   
   ## Root cause / Fix
   
   `readLabels` treated a row-level decode failure as fatal. Both repositories 
now degrade an unreadable `labels_json` to an empty label map so the read 
succeeds; the healthy row keeps its labels.
   
   ## Priority / scoring
   
   PRIORITY 55 = impact 20 (system-alert list 500 + native alerting pipeline 
stops) + blast radius 20 (every page read and every business evaluation) + 
reproducibility 10 (needs one corrupt row, no user input) + maintenance value 
5. FIX_CONFIDENCE 90.
   
   ## Tests
   
   - `mvn test 
-Dtest=MybatisPlusAlertRepositoryTest#pageAlertsShouldTolerateACorruptLabelsRowInsteadOfFailingTheQuery`
     - pre-fix: `Tests run: 1, Errors: 1` — `IllegalStateException: Unable to 
read alert labels`
     - post-fix: passes
   - `mvn test 
-Dtest=MybatisPlusAlertRepositoryTest,MybatisPlusAlertStateRepositoryTest,NativeAlertProcessorTest,AlertServiceTest`
 → `Tests run: 112, Failures: 0, Errors: 0` (post-fix), BUILD SUCCESS
   
   ## Risk
   
   Low. Behavior changes only for rows whose `labels_json` cannot be parsed: 
they previously broke the whole read, now they render with empty labels. No 
schema or API shape change.
   


-- 
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]

Reply via email to