You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "unbridled-41 (via GitHub)" <gi...@apache.org> on 2026/09/05 09:50:48 UTC
[PR] [ISSUE #11037] Encode delay message propertiesString after internal properties are cleared [rocketmq]
unbridled-41 opened a new pull request, #11038:
URL: https://github.com/apache/rocketmq/pull/11038
### Problem / Evidence
`ScheduleMessageService#messageTimeUp` encodes the delivered delay message's `propertiesString` **before** the internal properties are cleared (encode at the top of the method, `clearProperty` for `DELAY_TIME_LEVEL` / `TIMER_DELIVER_MS` / `TIMER_DELAY_SEC` afterwards). `propertiesString` is 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 e533b663f, `TimerMessageStore#convertMessage` now encodes after clearing). The identical pattern in `messageTimeUp` predates it (the 2022-era unmerged PR #4190 attempted the same cleanup) and was not covered.
Regression test `ScheduleMessageServiceTest#testMessageTimeUpPropertiesStringMatchesProperties` fails before the fix (propertiesString contains `DELAY_TIME_LEVEL`/`TIMER_DELIVER_MS` and differs from re-encoding the cleared map) and passes after.
### Root cause / Fix
Move the `setPropertiesString(...)` call after the `clearProperty(...)` calls and encode `msgInner.getProperties()` — mirroring the upstream-accepted fix in `TimerMessageStore#convertMessage`.
### Priority
PRIORITY = 74:影响 28(延迟消息是核心特性,每条延迟投递消息的线上属性与 broker 端属性不一致,内部属性泄漏给消费者)+ 波及范围 12(单方法,全部延迟消息)+ 可复现性 20(确定性单元测试)+ 维护价值 14(与上游刚合并的 #10972 同类修复,先例明确)。FIX_CONFIDENCE = 95(一行位置调整,镜像上游已接受的同型修复)。
### Tests
- `mvn -pl broker test -Dtest=ScheduleMessageServiceTest#testMessageTimeUpPropertiesStringMatchesProperties`
- before fix (commit ff8f6f74c + test only): `Tests run: 1, Failures: 1` (AssertionError at line 298)
- after fix: `Tests run: 1, Failures: 0`
- `mvn -pl broker test -Dtest=ScheduleMessageServiceTest`: `Tests run: 5, Failures: 0, Errors: 0`
### Risk
Low. The only behavior change is that the persisted `propertiesString` of 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.
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ISSUE #11037] Encode delay message propertiesString after internal properties are cleared [rocketmq]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #11038:
URL: https://github.com/apache/rocketmq/pull/11038#issuecomment-5551135160
## [Codecov](https://app.codecov.io/gh/apache/rocketmq/pull/11038?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 48.75%. Comparing base ([`ff8f6f7`](https://app.codecov.io/gh/apache/rocketmq/commit/ff8f6f74c560e391261ccd716707c6d20422e253?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`f7752f5`](https://app.codecov.io/gh/apache/rocketmq/commit/f7752f5a36cc03f90b6ed2d63a705103c78af950?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## develop #11038 +/- ##
=============================================
- Coverage 48.86% 48.75% -0.11%
+ Complexity 13796 13765 -31
=============================================
Files 1381 1381
Lines 101574 101574
Branches 13213 13213
=============================================
- Hits 49636 49527 -109
- Misses 45925 46022 +97
- Partials 6013 6025 +12
```
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/rocketmq/pull/11038?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
</details>
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ISSUE #11037] Encode delay message propertiesString after internal properties are cleared [rocketmq]
Posted by "unbridled-41 (via GitHub)" <gi...@apache.org>.
unbridled-41 commented on PR #11038:
URL: https://github.com/apache/rocketmq/pull/11038#issuecomment-5551614593
Evidence chain (audit 2026-09-05):
**Before the fix** — base ff8f6f74c + regression test only (production change stashed):
```
mvn -pl broker test -Dtest=ScheduleMessageServiceTest#testMessageTimeUpPropertiesStringMatchesProperties
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
java.lang.AssertionError
at ...ScheduleMessageServiceTest.testMessageTimeUpPropertiesStringMatchesProperties(ScheduleMessageServiceTest.java:298)
```
The first failing assertion is `assertFalse(delivered.getPropertiesString().contains(MessageConst.PROPERTY_DELAY_TIME_LEVEL))` — pre-fix the persisted wire string still carries `DELAY_TIME_LEVEL`/`TIMER_DELIVER_MS` and differs from re-encoding the cleared property map.
**After the fix** — branch tip f7752f5a3, re-measured 2026-09-05:
```
mvn -pl broker test -Dtest=ScheduleMessageServiceTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0
```
Precedent anchor: the identical defect class in `TimerMessageStore#convertMessage` was fixed upstream in e533b663f (ISSUE #10972, encode after `clearProperty`, encode `msgInner.getProperties()`); the schedule path was not covered there, and the 2022-era PR #4190 that attempted it was closed unmerged.
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ISSUE #11037] Encode delay message propertiesString after internal properties are cleared [rocketmq]
Posted by "unbridled-41 (via GitHub)" <gi...@apache.org>.
unbridled-41 closed pull request #11038: [ISSUE #11037] Encode delay message propertiesString after internal properties are cleared
URL: https://github.com/apache/rocketmq/pull/11038
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org