This is an automated email from the ASF dual-hosted git repository.
jinrongtong pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git
The following commit(s) were added to refs/heads/develop by this push:
new e7f29798e [ISSUE #6518] Fix bug that multi-threaded using bytebuffer
e7f29798e is described below
commit e7f29798ece70e218f7233a7ec85f01e8706a062
Author: guyinyou <[email protected]>
AuthorDate: Fri Mar 31 17:03:37 2023 +0800
[ISSUE #6518] Fix bug that multi-threaded using bytebuffer
Co-authored-by: guyinyou <[email protected]>
---
.../src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
a/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java
b/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java
index 117f20481..dc8e3efdb 100644
--- a/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java
+++ b/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java
@@ -2885,7 +2885,7 @@ public class DefaultMessageStore implements MessageStore {
BatchDispatchRequest task =
batchDispatchRequestQueue.peek();
batchDispatchRequestExecutor.execute(() -> {
try {
- ByteBuffer tmpByteBuffer =
task.byteBuffer.duplicate();
+ ByteBuffer tmpByteBuffer = task.byteBuffer;
tmpByteBuffer.position(task.position);
tmpByteBuffer.limit(task.position + task.size);
List<DispatchRequest> dispatchRequestList = new
ArrayList<>();
@@ -3018,7 +3018,7 @@ public class DefaultMessageStore implements MessageStore {
return;
}
mappedPageHoldCount.getAndIncrement();
- BatchDispatchRequest task = new BatchDispatchRequest(byteBuffer,
position, size, batchId++);
+ BatchDispatchRequest task = new
BatchDispatchRequest(byteBuffer.duplicate(), position, size, batchId++);
batchDispatchRequestQueue.offer(task);
}