Repository navigation
[ISSUE #11037] Encode delay message propertiesString after clearing internal properties - #11505
Conversation
…ring internal properties ScheduleMessageService#messageTimeUp encoded msgInner.propertiesString from msgExt.getProperties() before PROPERTY_DELAY_TIME_LEVEL, PROPERTY_TIMER_DELIVER_MS and PROPERTY_TIMER_DELAY_SEC were cleared. MessageAccessor.clearProperty only removes entries from the property map, so the persisted wire data kept the internal properties while the in-memory map did not. Encode after the properties are finalized, matching the ordering already used by TimerMessageStore#convertMessage. Add a regression test that asserts the delivered propertiesString contains none of the internal properties and equals a re-encoding of the final property map.
|
Friendly ping — could a committer approve the CI run for this PR? The regression test fails without the production change and passes with it. Happy to adjust anything if needed. |
|
Local verification on this branch (JDK 17):
One process item is still blocking the PR: every pull-request workflow run ( |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #11505 +/- ##
=============================================
- Coverage 49.87% 49.80% -0.08%
+ Complexity 14420 14405 -15
=============================================
Files 1391 1391
Lines 103361 103361
Branches 13519 13519
=============================================
- Hits 51554 51478 -76
- Misses 45601 45665 +64
- Partials 6206 6218 +12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
What is the purpose of the change
ScheduleMessageService#messageTimeUpencodespropertiesStringfrommsgExt.getProperties()before removing the internal scheduling properties.MessageAccessor.clearPropertyonly removes entries from the in-memory property map, so the encoded wire data — which is what gets persisted and decoded by consumers — still carriesDELAY_TIME_LEVEL,TIMER_DELIVER_MSandTIMER_DELAY_SEC.Move the encoding after the
clearPropertycalls and encodemsgInner.getProperties(), matching the ordering already used byTimerMessageStore#convertMessage(the timer-wheel path fixed in #10972).Brief changelog
propertiesStringafter the internal properties are cleared.ScheduleMessageServiceTest#testMessageTimeUpPropertiesStringMatchesProperties, which asserts that the delivered message'spropertiesStringcontains none of the internal properties and equals a re-encoding of the final property map.Verifications
AssertionErroronassertFalse(delivered.getPropertiesString().contains(PROPERTY_DELAY_TIME_LEVEL)).Tests run: 5, Failures: 0, Errors: 0, Skipped: 0.Fixes #11037.
Note: an earlier attempt, #11038, was closed unmerged. This PR is an independent implementation of the fix with a regression test, as the issue is still open.