Skip to content

fix(alert): preserve recurring maintenance boundaries across DST - #4090

Open
yuluo-yx wants to merge 1 commit into
apache:rocketmq-studiofrom
yuluo-yx:0908-yuluo-yx/fix-recurring-silence-dst
Open

fix(alert): preserve recurring maintenance boundaries across DST#4090
yuluo-yx wants to merge 1 commit into
apache:rocketmq-studiofrom
yuluo-yx:0908-yuluo-yx/fix-recurring-silence-dst

Conversation

@yuluo-yx

@yuluo-yx yuluo-yx commented Sep 8, 2026

Copy link
Copy Markdown
Member

变更目的

修复周期维护窗口在夏令时切换时错误延迟或提前发送告警的问题。

  • 纽约每日 02:30–04:00 的窗口在 2026-03-08 应解析为 03:30–04:00;旧实现错误延长到 05:00。
  • 首个窗口明确选择秋季重复时段的 -05:00 偏移时,旧实现重新解析为 -04:00,导致有效窗口被跳过。

修改内容

首个窗口保留请求指定的确切起止瞬间;后续窗口从名义当地时间分别解析开始与结束边界。保留原有后续重复时段的偏移选择规则、星期限制和周期截止时间。没有新增依赖、配置或数据库字段。

13 个时间边界测试覆盖一小时/半小时缺口、秋季重复时段、跨日每周窗口与亚秒边界;6 个服务组合测试覆盖创建、UTC 存储、维护窗口计算和三种通知渠道入队时间。新增中文行为与回滚说明。

验证

基线:d6dee7d7ccfcf4886f02466ec51452a6928b2cc8,Java 21。

  • 三个最小复现在旧实现上全部失败。
  • mvn -B -ntp -Dtest=AlertSilenceScheduleTest,AlertSilenceDstTest,AlertSilenceServiceTest,RecurringSilenceNotificationTest,NotificationOutboxServiceTest test:65 个测试通过,Checkstyle 通过。
  • mvn -B -ntp -DskipTests package:构建通过。
  • JaCoCo:修复类行覆盖率 35/37(94.6%),分支覆盖率 38/44(86.4%)。
  • 全量后端测试:2,110 项,3 个失败。已在完全未修改的上游基线复现相同失败:AuthCorsIntegrationTest 两项、AliyunInstanceProviderTest#getGroupProgressShouldMapLagRowsTest 一项。
  • git diff --check:通过。4 个文件,416 行新增、18 行删除。

未运行真实集群 E2E、压力和混沌测试。本次时间计算仍只检查最多 8 个候选日期,通知测试不向外发送消息。上游既有依赖漏洞尚未由本 PR 处理,不能据此声称项目级漏洞门槛通过。

按贡献指南 #2107 将同一维护窗口语义的缺陷与验证合并。已核对 #3070 的原始功能、#3303 的七天周窗口修复和 #3415 的配置边界测试,本次处理的夏令时缺口与明确偏移不与其重复。

本地执行验证,提交使用 [skip ci],不会自动运行 pushpull_request 工作流。无迁移,直接替换;回滚本提交即可。

Resolve recurring start and end boundaries independently and preserve explicit seed offsets. Cover gap, overlap, weekly and notification deferral behavior.

[skip ci]

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Fixes recurring alert silence boundaries across DST transitions. Uses ZoneId and ZonedDateTime for proper DST handling instead of fixed-offset calculations. Comprehensive tests cover spring-forward and fall-back scenarios.

LGTM.


Automated review by github-manager-bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants