Repository navigation
[ISSUE #11037] Encode delay message propertiesString after internal properties are cleared - #11038
unbridled-41 wants to merge 1 commit into
Conversation
…rnal properties are cleared ScheduleMessageService#messageTimeUp encoded propertiesString before clearing DELAY_TIME_LEVEL / TIMER_DELIVER_MS / TIMER_DELAY_SEC, so the persisted wire data still carried the internal properties while the broker-side property map no longer did. Encode after the clears, aligning with TimerMessageStore#convertMessage (ISSUE apache#10972).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #11038 +/- ##
=============================================
- Coverage 48.86% 48.75% -0.11%
+ Complexity 13797 13765 -32
=============================================
Files 1381 1381
Lines 101574 101574
Branches 13213 13213
=============================================
- Hits 49638 49527 -111
- Misses 45924 46022 +98
- Partials 6012 6025 +13 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Evidence chain (audit 2026-09-05): Before the fix — base ff8f6f7 + regression test only (production change stashed): The first failing assertion is After the fix — branch tip f7752f5, re-measured 2026-09-05: Precedent anchor: the identical defect class in |
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Summary
Fixes delay message encoding to regenerate propertiesString after internal properties are cleared, ensuring consistency between the property map and wire data. The test verifies both the encoded bytes and the decoded property map.
LGTM.
Automated review by github-manager-bot
Problem / Evidence
ScheduleMessageService#messageTimeUpencodes the delivered delay message'spropertiesStringbefore the internal properties are cleared (encode at the top of the method,clearPropertyforDELAY_TIME_LEVEL/TIMER_DELIVER_MS/TIMER_DELAY_SECafterwards).propertiesStringis what gets persisted in the commitlog and decoded by consumers, so every delay-level message still carries those internal properties on the wire while the broker-side property map no longer does — the two disagree, and SQL92 filtering / user code see stale internal properties.This is the exact defect class fixed for the timer-wheel path by #10972 (commit e533b66,
TimerMessageStore#convertMessagenow encodes after clearing). The identical pattern inmessageTimeUppredates it (the 2022-era unmerged PR #4190 attempted the same cleanup) and was not covered.Regression test
ScheduleMessageServiceTest#testMessageTimeUpPropertiesStringMatchesPropertiesfails before the fix (propertiesString containsDELAY_TIME_LEVEL/TIMER_DELIVER_MSand differs from re-encoding the cleared map) and passes after.Root cause / Fix
Move the
setPropertiesString(...)call after theclearProperty(...)calls and encodemsgInner.getProperties()— mirroring the upstream-accepted fix inTimerMessageStore#convertMessage.Priority
PRIORITY = 74:影响 28(延迟消息是核心特性,每条延迟投递消息的线上属性与 broker 端属性不一致,内部属性泄漏给消费者)+ 波及范围 12(单方法,全部延迟消息)+ 可复现性 20(确定性单元测试)+ 维护价值 14(与上游刚合并的 #10972 同类修复,先例明确)。FIX_CONFIDENCE = 95(一行位置调整,镜像上游已接受的同型修复)。
Tests
mvn -pl broker test -Dtest=ScheduleMessageServiceTest#testMessageTimeUpPropertiesStringMatchesPropertiesTests run: 1, Failures: 1(AssertionError at line 298)Tests run: 1, Failures: 0mvn -pl broker test -Dtest=ScheduleMessageServiceTest:Tests run: 5, Failures: 0, Errors: 0Risk
Low. The only behavior change is that the persisted
propertiesStringof delivered delay messages no longer contains the three internal keys — this is what the property map already said since those lines existed, and matches the timer-path fix accepted in #10972. Consumers relying on the leaked internal keys would see them disappear, which is the documented intended behavior.Closes #11037