123123213weqw opened a new pull request, #7052:
URL: https://github.com/apache/rocketmq-dashboard/pull/7052

   Fixes #6436.
   
   A representable alert duration (`9223372036854775807s` — 
`Duration.ofSeconds(Long.MAX_VALUE)`) overflowed during evaluation: both named 
paths in `AlertStateMachine.advanceHit` constructed an out-of-range deadline 
(`pendingAt.plus(duration)` in the pending branch, 
`lastNotifiedAt.plus(reminderInterval)` in the reminder branch) and threw 
`ArithmeticException: long overflow` instead of evaluating.
   
   The state machine now compares elapsed time against the configured 
`Duration` directly (`Duration.between(pendingAt, now).compareTo(duration)`) 
without ever constructing an out-of-range deadline. Exact-boundary semantics 
are preserved (elapsed == duration still fires/reminds, covered by the existing 
299s/300s and 29min/30min cases), and clock rollback keeps the run pending / 
suppresses the reminder.
   
   Red-first: two new `AlertStateMachineTest` cases overflow on the old code on 
exactly the issue's paths; both pass with the fix. `AlertStateMachineTest` 9/9 
and `AlertRuleDurationTest` 11/11.
   
   Note on #6450 (filed in the same area): the repeated/reversed-unit grammar 
it describes was already fixed on base by #6451 (963e39e8b) — verified against 
the issue's expected accept/reject grammar, no change needed for that 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]

Reply via email to