Conversation
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #17734 +/- ##
============================================
+ Coverage 40.55% 40.58% +0.03%
Complexity 2574 2574
============================================
Files 5179 5179
Lines 349896 349941 +45
Branches 44727 44732 +5
============================================
+ Hits 141890 142018 +128
+ Misses 208006 207923 -83 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
luoluoyuyu
left a comment
There was a problem hiding this comment.
Review 总结
locallyScheduledCQs + markCQLocallyScheduled 能有效防止 CN 重启或 procedure 重入时同一 CQ 被重复 submit,drop 时清理 map 也正确。CreateCQProcedure 侧改动需结合完整 diff 再确认 token 生成与 recovery 路径。
整体可合入,建议处理行内关于 markCQLocallyScheduled 边界条件的说明/测试。
| locallyScheduledCQs.compute( | ||
| cqId, | ||
| (ignored, previousMd5) -> { | ||
| if (!md5.equals(previousMd5)) { |
There was a problem hiding this comment.
当 previousMd5 == null(首次 schedule)时,!md5.equals(previousMd5) 为 true,会 schedule —— 符合预期。
当 previousMd5 与 md5 相同(重复 startCQScheduler 或重复 submit)时返回 false 跳过 —— 符合预期。
潜在问题:若同一 cqId 的 CQ 定义被更新(md5 变化),会再次 schedule,但旧 CQScheduleTask 是否已 cancel?若未 cancel,可能短暂双跑。请确认 CreateCQProcedure / ActiveCQPlan 路径会先 drop 旧 task 或 CQScheduleTask 内部有 md5 校验。
建议:补 IT 或 UT:create CQ → restart scheduler → 仅 1 个 active task;drop CQ → map 中 entry 清除。
| } | ||
|
|
||
| public void unmarkCQLocallyScheduled(String cqId, String md5) { | ||
| locallyScheduledCQs.remove(cqId, md5); |
There was a problem hiding this comment.
ConcurrentMap.remove(cqId, md5) 仅在 value 精确匹配时删除,与 submitSelf 失败时 unmarkCQLocallyScheduled(entry.getCqId(), entry.getMd5()) 配合正确,可避免误删新一次 schedule 写入的 md5。
👍 这是好的并发细节。



Description
This PR fixes two CQ issues in ConfigNode:
task submission.
recreated CQ with the same cqId.
This PR has:
for an unfamiliar reader.
for code coverage.
Key changed/added classes (or packages if there are too many classes) in this PR