[ISSUE #9654] Optimize the bufferLocal size of the TimerMessageStore - #9655
Merged
Conversation
lizhimins
previously approved these changes
Sep 2, 2025
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #9655 +/- ##
=============================================
+ Coverage 48.12% 48.24% +0.11%
- Complexity 12076 13485 +1409
=============================================
Files 1313 1380 +67
Lines 92837 101093 +8256
Branches 11868 13102 +1234
=============================================
+ Hits 44677 48771 +4094
- Misses 42650 46342 +3692
- Partials 5510 5980 +470 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
RongtongJin
reviewed
Nov 4, 2025
| @Override | ||
| protected ByteBuffer initialValue() { | ||
| return ByteBuffer.allocateDirect(storeConfig.getMaxMessageSize() + 100); | ||
| return ByteBuffer.allocateDirect(storeConfig.getMaxMessageSize() + storeConfig.getTimerMessageBufferSize()); |
Contributor
There was a problem hiding this comment.
int maxMessageSize = Integer.MAX_VALUE - maxMessageBodySize >= 64 * 1024 ?
maxMessageBodySize + 64 * 1024 : Integer.MAX_VALUE;
Wouldn't it be better to follow the settings in MessageExtEncoder (lines 53–54)?
lizhimins
approved these changes
Aug 3, 2026
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.
Which Issue(s) This PR Fixes
Fixes #9654
Brief Description
There is a variable called bufferLocal in TimerMessageStore, which is used to store a single message from the commitlog. The initial size of bufferLocal is currently set to maxMessageSize plus 100 bytes. Since some properties may be added during the intermediate stages of scheduled messages, the maximum message size can exceed maxMessageSize. Although an extra 100 bytes is reserved during initialization, in some scenarios this is not sufficient, resulting in message read failures and subsequently blocking the entire scheduled message process.
How Did You Test This Change?