Repository navigation
[ISSUE #11037] Encode delay message propertiesString after clearing internal properties - #11505
Open
lihanyu1715446406-afk wants to merge 1 commit into
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.
Author
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.